Skip to content

Commit 2d06910

Browse files
committed
add now
chart and dataset changed_on use now for chart
1 parent 0787f4b commit 2d06910

File tree

1 file changed

+10
-3
lines changed
  • metadata-ingestion/src/datahub/ingestion/source

1 file changed

+10
-3
lines changed

metadata-ingestion/src/datahub/ingestion/source/superset.py

+10-3
Original file line numberDiff line numberDiff line change
@@ -401,8 +401,11 @@ def construct_dashboard_from_api_data(
401401
)
402402

403403
modified_actor = f"urn:li:corpuser:{self.owner_info.get((dashboard_data.get('changed_by') or {}).get('id', -1), 'unknown')}"
404+
405+
now = datetime.now().strftime("%I:%M%p on %B %d, %Y")
406+
404407
modified_ts = int(
405-
dp.parse(dashboard_data.get("changed_on_utc", "now")).timestamp() * 1000
408+
dp.parse(dashboard_data.get("changed_on", now)).timestamp() * 1000
406409
)
407410
title = dashboard_data.get("dashboard_title", "")
408411
# note: the API does not currently supply created_by usernames due to a bug
@@ -514,8 +517,9 @@ def construct_chart_from_chart_data(self, chart_data: dict) -> ChartSnapshot:
514517
)
515518

516519
modified_actor = f"urn:li:corpuser:{self.owner_info.get((chart_data.get('changed_by') or {}).get('id', -1), 'unknown')}"
520+
517521
modified_ts = int(
518-
dp.parse(chart_data.get("changed_on_utc", "now")).timestamp() * 1000
522+
dp.parse(datetime.now().strftime("%I:%M%p on %B %d, %Y")).timestamp() * 1000
519523
)
520524
title = chart_data.get("slice_name", "")
521525

@@ -782,8 +786,11 @@ def construct_dataset_from_dataset_data(
782786
dataset_url = f"{self.config.display_uri}{dataset_response.get('result', {}).get('url', '')}"
783787

784788
modified_actor = f"urn:li:corpuser:{self.owner_info.get((dataset_data.get('changed_by') or {}).get('id', -1), 'unknown')}"
789+
790+
now = datetime.now().strftime("%I:%M%p on %B %d, %Y")
791+
785792
modified_ts = int(
786-
dp.parse(dataset_data.get("changed_on_utc", "now")).timestamp() * 1000
793+
dp.parse(dataset_data.get("changed_on", now)).timestamp() * 1000
787794
)
788795
last_modified = AuditStampClass(time=modified_ts, actor=modified_actor)
789796

0 commit comments

Comments
 (0)