Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
remove previously defined event_timestamp_column from data_source to …
…allow for inference

Signed-off-by: Shai Bruhis <shaibruhis@gmail.com>
  • Loading branch information
shaibruhis committed Mar 12, 2022
commit ef17d06cedd8e7761c8b9eb0aa510067bcbc58a2
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,9 @@ class UniversalDataSources:
global_ds: DataSource
field_mapping: DataSource

def values(self):
return dataclasses.asdict(self).values()


def construct_universal_data_sources(
datasets: UniversalDatasets, data_source_creator: DataSourceCreator
Expand Down
10 changes: 7 additions & 3 deletions sdk/python/tests/integration/registration/test_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,19 @@ def test_update_file_data_source_with_inferred_event_timestamp_col(simple_datase
def test_update_data_sources_with_inferred_event_timestamp_col(universal_data_sources):
(_, _, data_sources) = universal_data_sources
Comment thread
adchia marked this conversation as resolved.
Outdated

# remove defined event_timestamp_column to allow for inference
for data_source in data_sources.values():
data_source.event_timestamp_column = None

update_data_sources_with_inferred_event_timestamp_col(
Comment thread
adchia marked this conversation as resolved.
Outdated
universal_data_sources.asdict().values(),
data_sources.values(),
RepoConfig(provider="local", project="test"),
)
actual_event_timestamp_cols = [
source.event_timestamp_column for source in data_sources
source.event_timestamp_column for source in data_sources.values()
]

assert actual_event_timestamp_cols == ["event_timestamp" * len(data_sources)]
assert actual_event_timestamp_cols == ["event_timestamp"] * len(data_sources.values())


def test_on_demand_features_type_inference():
Expand Down