Skip to content

Commit ee82a88

Browse files
authored
fix(ingest/dagster): Fix Dagster build (#12121)
1 parent d5e0513 commit ee82a88

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

.github/workflows/dagster-plugin.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ jobs:
3131
DATAHUB_TELEMETRY_ENABLED: false
3232
strategy:
3333
matrix:
34-
python-version: ["3.8", "3.10"]
34+
python-version: ["3.9", "3.10"]
3535
include:
36-
- python-version: "3.8"
36+
- python-version: "3.9"
3737
extraPythonRequirement: "dagster>=1.3.3"
3838
- python-version: "3.10"
3939
extraPythonRequirement: "dagster>=1.3.3"

metadata-ingestion-modules/dagster-plugin/setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def get_long_description():
123123
],
124124
# Package info.
125125
zip_safe=False,
126-
python_requires=">=3.8",
126+
python_requires=">=3.9",
127127
package_dir={"": "src"},
128128
packages=setuptools.find_namespace_packages(where="./src"),
129129
entry_points=entry_points,

metadata-ingestion-modules/dagster-plugin/src/datahub_dagster_plugin/sensors/datahub_sensors.py

+10-7
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,15 @@
2828
from dagster._core.definitions.multi_asset_sensor_definition import (
2929
AssetMaterializationFunctionReturn,
3030
)
31-
from dagster._core.definitions.sensor_definition import (
32-
DefaultSensorStatus,
33-
RawSensorEvaluationFunctionReturn,
34-
)
31+
from dagster._core.definitions.sensor_definition import DefaultSensorStatus
32+
33+
# This SensorReturnTypesUnion is from Dagster 1.9.1+ and is not available in older versions
34+
# of Dagster. We need to import it conditionally to avoid breaking compatibility with older
35+
try:
36+
from dagster._core.definitions.sensor_definition import SensorReturnTypesUnion
37+
except ImportError:
38+
from dagster._core.definitions.sensor_definition import RawSensorEvaluationFunctionReturn as SensorReturnTypesUnion # type: ignore
39+
3540
from dagster._core.definitions.target import ExecutableDefinition
3641
from dagster._core.definitions.unresolved_asset_job_definition import (
3742
UnresolvedAssetJobDefinition,
@@ -689,9 +694,7 @@ def _emit_asset_metadata(
689694

690695
return SkipReason("Asset metadata processed")
691696

692-
def _emit_metadata(
693-
self, context: RunStatusSensorContext
694-
) -> RawSensorEvaluationFunctionReturn:
697+
def _emit_metadata(self, context: RunStatusSensorContext) -> SensorReturnTypesUnion:
695698
"""
696699
Function to emit metadata for datahub rest.
697700
"""

0 commit comments

Comments
 (0)