sdv 1.33.2.dev0__tar.gz → 1.34.1.dev0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sdv-1.33.2.dev0/sdv.egg-info → sdv-1.34.1.dev0}/PKG-INFO +1 -1
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/pyproject.toml +1 -1
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/__init__.py +1 -1
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/metadata/metadata.py +19 -5
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/metadata/multi_table.py +20 -9
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0/sdv.egg-info}/PKG-INFO +1 -1
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/LICENSE +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/README.md +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/_utils.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/cag/__init__.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/cag/_errors.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/cag/_utils.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/cag/base.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/cag/fixed_combinations.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/cag/fixed_increments.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/cag/inequality.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/cag/one_hot_encoding.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/cag/programmable_constraint.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/cag/range.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/constraints/__init__.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/constraints/base.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/constraints/errors.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/constraints/tabular.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/constraints/utils.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/data_processing/__init__.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/data_processing/data_processor.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/data_processing/datetime_formatter.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/data_processing/errors.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/data_processing/numerical_formatter.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/data_processing/utils.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/datasets/__init__.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/datasets/demo.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/datasets/local.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/errors.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/evaluation/__init__.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/evaluation/_utils.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/evaluation/multi_table.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/evaluation/single_table.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/io/__init__.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/io/local/__init__.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/io/local/local.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/lite/__init__.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/lite/single_table.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/logging/__init__.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/logging/logger.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/logging/sdv_logger_config.yml +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/logging/utils.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/metadata/__init__.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/metadata/errors.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/metadata/metadata_upgrader.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/metadata/single_table.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/metadata/utils.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/metadata/visualization.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/metrics/__init__.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/metrics/demos.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/metrics/relational.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/metrics/tabular.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/metrics/timeseries.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/multi_table/__init__.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/multi_table/base.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/multi_table/dayz.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/multi_table/hma.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/multi_table/utils.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/sampling/__init__.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/sampling/hierarchical_sampler.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/sampling/independent_sampler.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/sampling/tabular.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/sequential/__init__.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/sequential/par.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/single_table/__init__.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/single_table/base.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/single_table/copulagan.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/single_table/copulas.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/single_table/ctgan.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/single_table/dayz.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/single_table/utils.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/utils/__init__.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/utils/mixins.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/utils/poc.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/utils/utils.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv/version/__init__.py +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv.egg-info/SOURCES.txt +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv.egg-info/dependency_links.txt +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv.egg-info/entry_points.txt +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv.egg-info/requires.txt +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/sdv.egg-info/top_level.txt +0 -0
- {sdv-1.33.2.dev0 → sdv-1.34.1.dev0}/setup.cfg +0 -0
|
@@ -150,7 +150,7 @@ namespaces = false
|
|
|
150
150
|
version = {attr = 'sdv.__version__'}
|
|
151
151
|
|
|
152
152
|
[tool.bumpversion]
|
|
153
|
-
current_version = "1.
|
|
153
|
+
current_version = "1.34.1.dev0"
|
|
154
154
|
parse = '(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>[a-z]+)(?P<candidate>\d+))?'
|
|
155
155
|
serialize = [
|
|
156
156
|
'{major}.{minor}.{patch}.{release}{candidate}',
|
|
@@ -325,7 +325,7 @@ class Metadata(MultiTableMetadata):
|
|
|
325
325
|
table_name = self._handle_table_name(table_name)
|
|
326
326
|
super().add_column(table_name, column_name, **kwargs)
|
|
327
327
|
|
|
328
|
-
def
|
|
328
|
+
def _remove_relationships_by_table(self, element, keys):
|
|
329
329
|
"""Remove relationships where the element matches the keys to check."""
|
|
330
330
|
updated_relationships = []
|
|
331
331
|
for relationship in self.relationships:
|
|
@@ -335,6 +335,22 @@ class Metadata(MultiTableMetadata):
|
|
|
335
335
|
|
|
336
336
|
self.relationships = updated_relationships
|
|
337
337
|
|
|
338
|
+
def _remove_relationships_by_column(self, table_name, column_name):
|
|
339
|
+
"""Remove relationships where the column is a key for the given table."""
|
|
340
|
+
updated_relationships = []
|
|
341
|
+
for relationship in self.relationships:
|
|
342
|
+
should_remove = (
|
|
343
|
+
relationship['child_foreign_key'] == column_name
|
|
344
|
+
and relationship['child_table_name'] == table_name
|
|
345
|
+
) or (
|
|
346
|
+
relationship['parent_primary_key'] == column_name
|
|
347
|
+
and relationship['parent_table_name'] == table_name
|
|
348
|
+
)
|
|
349
|
+
if not should_remove:
|
|
350
|
+
updated_relationships.append(relationship)
|
|
351
|
+
|
|
352
|
+
self.relationships = updated_relationships
|
|
353
|
+
|
|
338
354
|
def remove_table(self, table_name):
|
|
339
355
|
"""Remove a table from the metadata.
|
|
340
356
|
|
|
@@ -348,7 +364,7 @@ class Metadata(MultiTableMetadata):
|
|
|
348
364
|
self._validate_table_exists(table_name)
|
|
349
365
|
|
|
350
366
|
# Remove relationships
|
|
351
|
-
self.
|
|
367
|
+
self._remove_relationships_by_table(table_name, ['parent_table_name', 'child_table_name'])
|
|
352
368
|
del self.tables[table_name]
|
|
353
369
|
self._multi_table_updated = True
|
|
354
370
|
|
|
@@ -380,9 +396,7 @@ class Metadata(MultiTableMetadata):
|
|
|
380
396
|
table_metadata._validate_column_exists(column_name)
|
|
381
397
|
|
|
382
398
|
# Remove relationships
|
|
383
|
-
self.
|
|
384
|
-
column_name, ['parent_primary_key', 'child_foreign_key']
|
|
385
|
-
)
|
|
399
|
+
self._remove_relationships_by_column(table_name, column_name)
|
|
386
400
|
updated_column_relationships = []
|
|
387
401
|
for column_relationship in table_metadata.column_relationships:
|
|
388
402
|
if column_name not in column_relationship.get('column_names', []):
|
|
@@ -543,25 +543,36 @@ class MultiTableMetadata:
|
|
|
543
543
|
"""
|
|
544
544
|
for parent_candidate in self.tables.keys():
|
|
545
545
|
primary_key = self.tables[parent_candidate].primary_key
|
|
546
|
+
if primary_key is None:
|
|
547
|
+
continue
|
|
548
|
+
|
|
549
|
+
pk_sdtype = self.tables[parent_candidate].columns[primary_key]['sdtype']
|
|
546
550
|
for child_candidate in self.tables.keys() - {parent_candidate}:
|
|
547
551
|
child_meta = self.tables[child_candidate]
|
|
548
552
|
if primary_key in child_meta.columns.keys():
|
|
553
|
+
original_fk_meta = deepcopy(child_meta.columns[primary_key])
|
|
554
|
+
original_fk_sdtype = original_fk_meta['sdtype']
|
|
555
|
+
if pk_sdtype != 'id' and original_fk_sdtype != pk_sdtype:
|
|
556
|
+
continue
|
|
557
|
+
|
|
549
558
|
try:
|
|
550
|
-
|
|
551
|
-
if original_foreign_key_sdtype != 'id':
|
|
559
|
+
if pk_sdtype == 'id' and original_fk_sdtype != 'id':
|
|
552
560
|
self.update_column(
|
|
553
|
-
table_name=child_candidate,
|
|
561
|
+
table_name=child_candidate,
|
|
562
|
+
column_name=primary_key,
|
|
563
|
+
sdtype='id',
|
|
554
564
|
)
|
|
555
|
-
|
|
556
565
|
self.add_relationship(
|
|
557
566
|
parent_candidate, child_candidate, primary_key, primary_key
|
|
558
567
|
)
|
|
568
|
+
|
|
559
569
|
except InvalidMetadataError:
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
570
|
+
if pk_sdtype == 'id' and original_fk_sdtype != 'id':
|
|
571
|
+
self.update_column(
|
|
572
|
+
table_name=child_candidate,
|
|
573
|
+
column_name=primary_key,
|
|
574
|
+
**original_fk_meta,
|
|
575
|
+
)
|
|
565
576
|
continue
|
|
566
577
|
|
|
567
578
|
def _detect_relationships(self, data=None, foreign_key_inference_algorithm='column_name_match'):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|