sdv-dev / SDV

Synthetic data generation for tabular data
https://docs.sdv.dev/sdv
Other
2.32k stars 305 forks source link

add_column() method does not have documentation for SingleTableMetadata and MultiTableMetadata #1425

Closed R-Palazzo closed 1 year ago

R-Palazzo commented 1 year ago

There is no documentation for the add_column method for the SingleTableMetadata and MultiTableMetadata.

npatki commented 1 year ago

This feature is not officially supported in the SDV library and therefore was not included in the documentation.

In practice, we only see this being used for creating dummy/demo datasets and there is another method load_from_dict that can be used to achieve the same effect.

# current usage that we see
metadata = SingleTableMetadata()
metadata.add_column(
  'A',
  sdtype='numerical'
)

# recommended method
metadata = SingleTableMetadata.load_from_dict({
  'columns': {
    'A': { 'sdtype': 'numerical' }
  }
})

Alternatively, if you wish to add a new column ad-hoc (eg. if your schema has changed), you can: