Skip to content

Commit

Permalink
feat(api_connexion): add from_rest_api to extra of dataset event crea…
Browse files Browse the repository at this point in the history
…ted through api
  • Loading branch information
Lee-W committed Feb 23, 2024
1 parent 0aee4ba commit 33feb95
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions airflow/api_connexion/endpoints/dataset_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ def create_dataset_event(session: Session = NEW_SESSION) -> APIResponse:
raise NotFound(title="Dataset not found", detail=f"Dataset with uri: '{uri}' not found")
timestamp = timezone.utcnow()
extra = json_body.get("extra", {})
extra["from_rest_api"] = True
dataset_event = dataset_manager.register_dataset_change(
dataset=Dataset(uri),
timestamp=timestamp,
Expand Down
2 changes: 1 addition & 1 deletion tests/api_connexion/endpoints/test_dataset_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ def test_should_respond_200(self, session):
"created_dagruns": [],
"dataset_uri": event_payload["dataset_uri"],
"dataset_id": ANY,
"extra": {"foo": "bar"},
"extra": {"foo": "bar", "from_rest_api": True},
"source_dag_id": None,
"source_task_id": None,
"source_run_id": None,
Expand Down

0 comments on commit 33feb95

Please sign in to comment.