Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/data_designer/config/config_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ def from_config(cls, config: dict | str | Path | BuilderConfig) -> Self:
config = builder_config.data_designer

for col in config.columns:
builder.add_column(col)
if not isinstance(col, SeedDatasetColumnConfig):
builder.add_column(col)
Comment on lines +107 to +108
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure of the urgency here, if we'd want to land this and ship another patch release or what, but: I believe this entire problem should disappear (and this specific highlighted code become a no-op) once #167 lands. As part of those changes, we no longer save SeedDatasetColumnConfig columns on the config builder—it only has the SeedConfig, including through the config serde process.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh that's a great point

Maybe we can proceed as with the fix yesterday - land this quickly on a 0.2.x release, and leave other changes for 0.3?
Agree it's up to how urgent this is and whether we want to do a new 0.2.x release, will let @eric-tramel and @johnnygreco coordinate on that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excited for the much needed rework @mikeknep :)

For this case, simple process in my opinion:

  1. Main is bugged, should fix main quickly with this edit, ship a minor version today/tomorrow to unblock downstream users immediately.
  2. Update working-state main with new refactor and ship on its own schedule.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ sounds like a good plan 👍

I can publish the minor patch today.


for constraint in config.constraints or []:
builder.add_constraint(constraint=constraint)
Expand Down
15 changes: 15 additions & 0 deletions tests/config/test_config_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -846,3 +846,18 @@ def test_with_seed_dataset_no_collision(stub_empty_builder: DataDesignerConfigBu
assert stub_empty_builder.get_seed_config() is not None
assert len(stub_empty_builder.get_columns_of_type(DataDesignerColumnType.SEED_DATASET)) == 3
assert len(stub_empty_builder.get_columns_of_type(DataDesignerColumnType.SAMPLER)) == 1


def test_from_config_does_not_duplicate_seed_dataset_columns(
stub_data_designer_builder: DataDesignerConfigBuilder,
) -> None:
"""Regression test: seed dataset columns should not be duplicated during deserialization."""
with tempfile.TemporaryDirectory() as temp_dir:
config_path = Path(temp_dir) / "config.json"
stub_data_designer_builder.write_config(config_path)

with patch("data_designer.config.config_builder.fetch_seed_dataset_column_names") as mock_fetch:
mock_fetch.return_value = ["id", "name", "city", "country"]
reloaded_builder = DataDesignerConfigBuilder.from_config(config_path)

assert reloaded_builder.num_columns_of_type(DataDesignerColumnType.SEED_DATASET) == 4