Skip to content

PARSynthesizer: FutureWarnings in groupby.apply and Series.__getitem__ from pandas #2682

@pvk-developer

Description

@pvk-developer

Environment Details

Please indicate the following details about the environment in which you found the bug:

  • SDV version: 1.27.1.dev0
  • Python version: 3.13
  • Operating System: MacOS

Error Description

When fitting and sampling from a PARSynthesizer, I see FutureWarnings coming from pandas about deprecated behavior.

During Fit:

sdv/sequential/par.py:318: FutureWarning:
DataFrameGroupBy.apply operated on the grouping columns. This behavior is deprecated, and in a future version of pandas the grouping columns will be excluded from the operation. Either pass `include_groups=False` to exclude the groupings or explicitly select the grouping columns after groupby to silence this warning.

During Sample:

sdv/sequential/par.py:576: FutureWarning:
Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`

Steps to reproduce

from sdv.sequential import PARSynthesizer
from sdv.metadata.metadata import Metadata
from deepecho import load_demo

data = load_demo()
data['date'] = pd.to_datetime(data['date'])
metadata = Metadata.detect_from_dataframes({'table': data})
metadata.update_column('store_id', 'table', sdtype='id')
metadata.set_sequence_key('store_id', 'table')
                                                            
metadata.set_sequence_index('date', 'table')
                                                            
model = PARSynthesizer(
    metadata=metadata,
    context_columns=['region'],
    epochs=1,
)
                                                            
# Run
model.fit(data)
sampled = model.sample(100)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions