Skip to content

Commit d0b4421

Browse files
authored
Merge branch 'main' into open-source-2
2 parents 7f2b760 + c341726 commit d0b4421

File tree

573 files changed

+26002
-27348
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

573 files changed

+26002
-27348
lines changed

airflow/api_connexion/schemas/task_instance_schema.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class Meta:
6565
executor = auto_field()
6666
executor_config = auto_field()
6767
note = auto_field()
68-
rendered_map_index = auto_field()
68+
rendered_map_index = fields.String(attribute="rendered_map_index", dump_only=True)
6969
rendered_fields = JsonObjectField(dump_default={})
7070
trigger = fields.Nested(TriggerSchema)
7171
triggerer_job = fields.Nested(JobSchema)

airflow/cli/commands/local_commands/celery_command.py

-245
This file was deleted.

airflow/models/dag.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2279,7 +2279,7 @@ def dag_display_name(self) -> str:
22792279
:meta private:
22802280
"""
22812281
return case(
2282-
(self._dag_display_property_value.isnot(None), self._dag_display_property_value),
2282+
(self._dag_display_property_value.is_not(None), self._dag_display_property_value),
22832283
else_=self.dag_id,
22842284
)
22852285

airflow/models/taskinstance.py

+11-3
Original file line numberDiff line numberDiff line change
@@ -1675,7 +1675,7 @@ class TaskInstance(Base, LoggingMixin):
16751675
executor = Column(String(1000))
16761676
executor_config = Column(ExecutorConfigType(pickler=dill))
16771677
updated_at = Column(UtcDateTime, default=timezone.utcnow, onupdate=timezone.utcnow)
1678-
rendered_map_index = Column(String(250))
1678+
_rendered_map_index = Column("rendered_map_index", String(250))
16791679

16801680
external_executor_id = Column(StringID())
16811681

@@ -1846,6 +1846,14 @@ def operator_name(self) -> str | None:
18461846
def task_display_name(self) -> str:
18471847
return self._task_display_property_value or self.task_id
18481848

1849+
@hybrid_property
1850+
def rendered_map_index(self) -> str | None:
1851+
if self._rendered_map_index is not None:
1852+
return self._rendered_map_index
1853+
if self.map_index >= 0:
1854+
return str(self.map_index)
1855+
return None
1856+
18491857
@classmethod
18501858
def from_runtime_ti(cls, runtime_ti: RuntimeTaskInstanceProtocol) -> TaskInstance:
18511859
if runtime_ti.map_index is None:
@@ -2918,10 +2926,10 @@ def _render_map_index(context: Context, *, jinja_env: jinja2.Environment | None)
29182926
except Exception:
29192927
# If the task failed, swallow rendering error so it doesn't mask the main error.
29202928
with contextlib.suppress(jinja2.TemplateSyntaxError, jinja2.UndefinedError):
2921-
self.rendered_map_index = _render_map_index(context, jinja_env=jinja_env)
2929+
self._rendered_map_index = _render_map_index(context, jinja_env=jinja_env)
29222930
raise
29232931
else: # If the task succeeded, render normally to let rendering error bubble up.
2924-
self.rendered_map_index = _render_map_index(context, jinja_env=jinja_env)
2932+
self._rendered_map_index = _render_map_index(context, jinja_env=jinja_env)
29252933

29262934
# Run post_execute callback
29272935
self.task.post_execute(context=context, result=result)

airflow/models/taskinstancehistory.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class TaskInstanceHistory(Base):
9292
next_method = Column(String(1000))
9393
next_kwargs = Column(MutableDict.as_mutable(ExtendedJSON))
9494

95-
task_display_name = Column("task_display_name", String(2000), nullable=True)
95+
task_display_name = Column(String(2000), nullable=True)
9696
dag_version_id = Column(UUIDType(binary=False))
9797

9898
dag_version = relationship(

airflow/ui/src/components/RenderedJsonField.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ type Props = {
2828
} & FlexProps;
2929

3030
const RenderedJsonField = ({ content, jsonProps, ...rest }: Props) => {
31-
const contentFormatted = JSON.stringify(content, null, 4);
31+
const contentFormatted = JSON.stringify(content, undefined, 4);
3232
const { theme } = useTheme();
3333

3434
return (

airflow/ui/src/components/SearchDags/SearchDags.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ export const SearchDags = ({
8989
menuIsOpen
9090
onChange={onSelect}
9191
placeholder="Search Dags"
92+
// eslint-disable-next-line unicorn/no-null
9293
value={null} // null is required https://github.com/JedWatson/react-select/issues/3066
9394
/>
9495
</Field.Root>

airflow/ui/src/pages/Dag/Code/Code.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,9 @@ export const Code = () => {
138138
loadOptions={loadVersions}
139139
onChange={handleStateChange}
140140
placeholder="Dag Version"
141-
value={selectedVersion === null ? null : { label: selectedVersion, value: selectedVersion }} // null is required https://github.com/JedWatson/react-select/issues/3066
141+
// null is required https://github.com/JedWatson/react-select/issues/3066
142+
// eslint-disable-next-line unicorn/no-null
143+
value={selectedVersion === null ? null : { label: selectedVersion, value: selectedVersion }}
142144
/>
143145
</Field.Root>
144146

airflow/ui/src/pages/DagsList/DagsList.tsx

+11-7
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,17 @@ const columns: Array<ColumnDef<DAGWithLatestDagRunsResponse>> = [
9999
accessorKey: "last_run_start_date",
100100
cell: ({ row: { original } }) =>
101101
original.latest_dag_runs[0] ? (
102-
<DagRunInfo
103-
endDate={original.latest_dag_runs[0].end_date}
104-
logicalDate={original.latest_dag_runs[0].logical_date}
105-
runAfter={original.latest_dag_runs[0].run_after}
106-
startDate={original.latest_dag_runs[0].start_date}
107-
state={original.latest_dag_runs[0].state}
108-
/>
102+
<Link asChild color="fg.info" fontWeight="bold">
103+
<RouterLink to={`/dags/${original.dag_id}/runs/${original.latest_dag_runs[0].dag_run_id}`}>
104+
<DagRunInfo
105+
endDate={original.latest_dag_runs[0].end_date}
106+
logicalDate={original.latest_dag_runs[0].logical_date}
107+
runAfter={original.latest_dag_runs[0].run_after}
108+
startDate={original.latest_dag_runs[0].start_date}
109+
state={original.latest_dag_runs[0].state}
110+
/>
111+
</RouterLink>
112+
</Link>
109113
) : undefined,
110114
header: "Last Dag Run",
111115
},

airflow/ui/src/pages/Providers.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const columns: Array<ColumnDef<ProviderResponse>> = [
5050
{
5151
accessorKey: "description",
5252
cell: ({ row: { original } }) => {
53-
const urlRegex = /http(s)?:\/\/[\w.-]+(\.?:[\w.-]+)*([#/?][\w!#$%&'()*+,./:;=?@[\]~-]*)?/gu;
53+
const urlRegex = /https?:\/\/[\w.-]+(?:\.?:[\w.-]+)*(?:[#/?][\w!#$%&'()*+,./:;=?@[\]~-]*)?/gu;
5454
const urls = original.description.match(urlRegex);
5555
const cleanText = original.description.replaceAll(/\n(?:and)?/gu, " ").split(" ");
5656

airflow/ui/src/pages/TaskInstance/Details.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,11 @@ export const Details = () => {
136136
<Table.Row>
137137
<Table.Cell>Duration</Table.Cell>
138138
<Table.Cell>
139-
{getDuration(tryInstance?.start_date ?? null, tryInstance?.end_date ?? null)}s
139+
{
140+
// eslint-disable-next-line unicorn/no-null
141+
getDuration(tryInstance?.start_date ?? null, tryInstance?.end_date ?? null)
142+
}
143+
s
140144
</Table.Cell>
141145
</Table.Row>
142146
<Table.Row>

contributing-docs/03_contributors_quick_start.rst

+2
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,8 @@ see in CI in your local environment.
462462
--role Admin \
463463
464464
465+
.. note::
466+
``airflow users`` command is only available when `FAB auth manager <https://airflow.apache.org/docs/apache-airflow-providers-fab/stable/auth-manager/index.html>`_ is enabled.
465467

466468
7. Exiting the Breeze environment. After successfully finishing above command will leave you in container,
467469
type ``exit`` to exit the container. The database created before will remain and servers will be

0 commit comments

Comments
 (0)