diff --git a/feathr_project/feathr/definition/source.py b/feathr_project/feathr/definition/source.py index 1984c8fe5..4bb393549 100644 --- a/feathr_project/feathr/definition/source.py +++ b/feathr_project/feathr/definition/source.py @@ -288,7 +288,7 @@ def to_feature_config(self) -> str: anonymous: true {% endif %} } - {% if source.event_timestamp_column is defined %} + {% if source.event_timestamp_column %} timeWindowParameters: { timestampColumn: "{{source.event_timestamp_column}}" timestampColumnFormat: "{{source.timestamp_format}}" @@ -403,7 +403,7 @@ def to_feature_config(self) -> str: table: "{{source.table}}" {% endif %} } - {% if source.event_timestamp_column is defined %} + {% if source.event_timestamp_column %} timeWindowParameters: { timestampColumn: "{{source.event_timestamp_column}}" timestampColumnFormat: "{{source.timestamp_format}}" @@ -418,11 +418,11 @@ def get_required_properties(self): return [] def to_dict(self) -> Dict[str, str]: - ret = self.options.copy() + ret = {} ret["type"] = "sparksql" - if self.sql: + if hasattr(self, "sql"): ret["sql"] = self.sql - elif self.table: + elif hasattr(self, "table"): ret["table"] = self.table return ret @@ -462,7 +462,7 @@ def to_feature_config(self) -> str: {{option.key}}: "{{option.value}}" {% endfor %} } - {% if source.event_timestamp_column is defined %} + {% if source.event_timestamp_column %} timeWindowParameters: { timestampColumn: "{{source.event_timestamp_column}}" timestampColumnFormat: "{{source.timestamp_format}}"