Skip to content

Commit 458beab

Browse files
author
Cody Lin
committed
fixed tests
Signed-off-by: Cody Lin <codyl@twitter.com>
1 parent 6b3975a commit 458beab

File tree

2 files changed

+1
-35
lines changed

2 files changed

+1
-35
lines changed

sdk/python/feast/data_source.py

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -526,40 +526,6 @@ def validate(self):
526526
"""
527527
raise NotImplementedError
528528

529-
def _infer_event_timestamp_column(self, ts_column_type_regex_pattern):
530-
ERROR_MSG_PREFIX = "Unable to infer DataSource event_timestamp_column"
531-
USER_GUIDANCE = "Please specify event_timestamp_column explicitly."
532-
533-
if isinstance(self, FileSource) or isinstance(self, BigQuerySource):
534-
event_timestamp_column, matched_flag = None, False
535-
for col_name, col_datatype in self.get_table_column_names_and_types():
536-
if re.match(ts_column_type_regex_pattern, col_datatype):
537-
if matched_flag:
538-
raise TypeError(
539-
f"""
540-
{ERROR_MSG_PREFIX} due to multiple possible columns satisfying
541-
the criteria. {USER_GUIDANCE}
542-
"""
543-
)
544-
matched_flag = True
545-
event_timestamp_column = col_name
546-
if matched_flag:
547-
return event_timestamp_column
548-
else:
549-
raise TypeError(
550-
f"""
551-
{ERROR_MSG_PREFIX} due to an absence of columns that satisfy the criteria.
552-
{USER_GUIDANCE}
553-
"""
554-
)
555-
else:
556-
raise TypeError(
557-
f"""
558-
{ERROR_MSG_PREFIX} because this DataSource currently does not support this inference.
559-
{USER_GUIDANCE}
560-
"""
561-
)
562-
563529

564530
class FileSource(DataSource):
565531
def __init__(

sdk/python/feast/repo_operations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,11 @@ def apply_total(repo_config: RepoConfig, repo_path: Path):
159159
assert_offline_store_supports_data_source(
160160
repo_config.offline_store, data_source
161161
)
162+
data_source.validate()
162163

163164
update_data_sources_with_inferred_event_timestamp_col(data_sources)
164165
for view in repo.feature_views:
165166
view.infer_features_from_input_source()
166-
data_source.validate()
167167

168168
tables_to_delete = []
169169
for registry_table in registry.list_feature_tables(project=project):

0 commit comments

Comments
 (0)