Skip to content

Commit

Permalink
Updated test values for task instances
Browse files Browse the repository at this point in the history
  • Loading branch information
atulya-astronomer committed Nov 7, 2024
1 parent 020fabf commit 9259111
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions astronomer_starship/compat/starship_compatability.py
Original file line number Diff line number Diff line change
Expand Up @@ -1041,6 +1041,11 @@ def task_instance_attrs(self):
}
return attrs

def task_instances_attrs(self):
attrs = super().task_instances_attrs()
attrs["task_instances"]["test_value"][0]["custom_operator_name"] = None
return attrs


class StarshipAirflow28(StarshipAirflow27):
"""
Expand Down Expand Up @@ -1072,16 +1077,26 @@ def task_instance_attrs(self):
attrs = super().task_instance_attrs()
attrs["rendered_map_index"] = {
"attr": "rendered_map_index",
"methods": [("POST", False)],
"methods": [("POST", True)],
"test_value": "rendered_map_index",
}
attrs["task_display_name"] = {
"attr": "task_display_name",
"methods": [("POST", False)],
"methods": [("POST", True)],
"test_value": "task_display_name",
}
return attrs

def task_instances_attrs(self):
attrs = super().task_instances_attrs()
attrs["task_instances"]["test_value"][0][
"rendered_map_index"
] = "rendered_map_index"
attrs["task_instances"]["test_value"][0][
"task_display_name"
] = "task_display_name"
return attrs


class StarshipAirflow210(StarshipAirflow28):
"""
Expand All @@ -1093,18 +1108,19 @@ class StarshipAirflow210(StarshipAirflow28):

def task_instance_attrs(self):
attrs = super().task_instance_attrs()
attrs["try_number"] = {
"attr": "try_number",
"methods": [("POST", True)],
"test_value": 0,
}
attrs["try_number"]["attr"] = "try_number"
attrs["executor"] = {
"attr": "executor",
"methods": [("POST", True)],
"test_value": "executor",
}
return attrs

def task_instances_attrs(self):
attrs = super().task_instances_attrs()
attrs["task_instances"]["test_value"][0]["executor"] = "executor"
return attrs


class StarshipCompatabilityLayer:
"""StarshipCompatabilityLayer is a factory class that returns the correct StarshipAirflow class for a version
Expand Down

0 comments on commit 9259111

Please sign in to comment.