You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "pierrejeambrun (via GitHub)" <gi...@apache.org> on 2024/12/02 16:18:13 UTC
[PR] AIP-38 Plug Graph on backend endpoint [airflow]
pierrejeambrun opened a new pull request, #44572:
URL: https://github.com/apache/airflow/pull/44572
(no comment)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] AIP-38 Plug Graph on backend endpoint [airflow]
Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi commented on code in PR #44572:
URL: https://github.com/apache/airflow/pull/44572#discussion_r1868083594
##########
airflow/ui/openapi-gen/requests/types.gen.ts:
##########
@@ -761,15 +761,15 @@ export type JobResponse = {
*/
export type NodeResponse = {
children?: Array<NodeResponse> | null;
- id: string | null;
+ id: string;
is_mapped?: boolean | null;
- label?: string | null;
+ label: string;
tooltip?: string | null;
setup_teardown_type?: "setup" | "teardown" | null;
- type: "join" | "sensor" | "task" | "task_group";
+ type: "join" | "sensor" | "task" | "asset_condition";
Review Comment:
I just realized that we're missing the `operator`. On the task node type spec.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] AIP-38 Plug Graph on backend endpoint [airflow]
Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on PR #44572:
URL: https://github.com/apache/airflow/pull/44572#issuecomment-2514016258
Yes, one of the issue we have is that I am not aware as of today of a way to have a datamodel generates something like:
```python
{
field?: string
}
```
i.e have the field `optional/can be missing from the payload` (`?:`), but has no default value / not nullable...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] AIP-38 Plug Graph on backend endpoint [airflow]
Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on code in PR #44572:
URL: https://github.com/apache/airflow/pull/44572#discussion_r1866244961
##########
airflow/api_fastapi/core_api/openapi/v1-generated.yaml:
##########
@@ -7815,11 +7811,12 @@ components:
- join
- sensor
- task
- - task_group
+ - asset_condition
Review Comment:
Not used at the moment, but needed to remove an eslint error (non overlapping check on the enum value)
##########
airflow/ui/src/pages/DagsList/Dag/Graph/Graph.tsx:
##########
@@ -35,10 +36,16 @@ const nodeTypes = {
};
const edgeTypes = { custom: Edge };
-export const Graph = () => {
+export const Graph = ({ dagId }: { readonly dagId: DAGResponse["dag_id"] }) => {
const { colorMode } = useColorMode();
const { openGroupIds } = useOpenGroups();
+
+ const { data: graphData = { arrange: "LR", edges: [], nodes: [] } } =
Review Comment:
Type system is not happy if I use `placeHolder` option. (Undefined is not type guarded, and fails later)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] AIP-38 Plug Graph on backend endpoint [airflow]
Posted by "tirkarthi (via GitHub)" <gi...@apache.org>.
tirkarthi commented on PR #44572:
URL: https://github.com/apache/airflow/pull/44572#issuecomment-2513540866
I also remember seeing some errors in backend from pydantic where `rx` and `ry` were missing. Sample example dag example_setup_teardown had the issue.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] AIP-38 Plug Graph on backend endpoint [airflow]
Posted by "tirkarthi (via GitHub)" <gi...@apache.org>.
tirkarthi commented on PR #44572:
URL: https://github.com/apache/airflow/pull/44572#issuecomment-2513532882
Thanks for the PR, I was also working on the same thing yesterday but couldn't fix linters and typescript issues as a draft PR. Many of them were related to undefined vs null checks and the structure used in `./data` file being different compared to the API response causing type incompatibility.
https://github.com/tirkarthi/airflow/commit/e444d8459c70c1349271fa3b91d5d129480dc564
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] AIP-38 Plug Graph on backend endpoint [airflow]
Posted by "tirkarthi (via GitHub)" <gi...@apache.org>.
tirkarthi commented on PR #44572:
URL: https://github.com/apache/airflow/pull/44572#issuecomment-2513533987
Related issue for tracking https://github.com/apache/airflow/issues/44200
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] AIP-38 Plug Graph on backend endpoint [airflow]
Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi commented on code in PR #44572:
URL: https://github.com/apache/airflow/pull/44572#discussion_r1868083594
##########
airflow/ui/openapi-gen/requests/types.gen.ts:
##########
@@ -761,15 +761,15 @@ export type JobResponse = {
*/
export type NodeResponse = {
children?: Array<NodeResponse> | null;
- id: string | null;
+ id: string;
is_mapped?: boolean | null;
- label?: string | null;
+ label: string;
tooltip?: string | null;
setup_teardown_type?: "setup" | "teardown" | null;
- type: "join" | "sensor" | "task" | "task_group";
+ type: "join" | "sensor" | "task" | "asset_condition";
Review Comment:
I just realized that we're missing the `operator`. On the task node type spec.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] AIP-38 Plug Graph on backend endpoint [airflow]
Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on PR #44572:
URL: https://github.com/apache/airflow/pull/44572#issuecomment-2514106717
Both setup and teardown example dags (`example_setup_teardown` and `example_setup_teardown_taskflow`) seem to render properly:


--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] AIP-38 Plug Graph on backend endpoint [airflow]
Posted by "tirkarthi (via GitHub)" <gi...@apache.org>.
tirkarthi commented on PR #44572:
URL: https://github.com/apache/airflow/pull/44572#issuecomment-2514494899
> Both setup and teardown example dags (`example_setup_teardown` and `example_setup_teardown_taskflow`) seem to render properly (things have been updated since you last tried, especially the API side):
Thanks for validating. I rebased my branch with latest main and now it's working fine as expected. Probably fixed as part of #44459 . Below was the old traceback,
```
File "/home/karthikeyan/stuff/python/airflow/airflow/api_fastapi/core_api/routes/ui/graph.py", line 60, in graph_data
return GraphDataResponse(**data)
File "/home/karthikeyan/stuff/python/airflow/.env/lib/python3.10/site-packages/pydantic/main.py", line 214, in __init__
validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self)
pydantic_core._pydantic_core.ValidationError: 2 validation errors for GraphDataResponse
nodes.children.3.children.3.value.rx
Field required [type=missing, input_value={'label': '', 'labelStyle...ue;', 'shape': 'circle'}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.10/v/missing
nodes.children.3.children.3.value.ry
Field required [type=missing, input_value={'label': '', 'labelStyle...ue;', 'shape': 'circle'}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.10/v/missing
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] AIP-38 Plug Graph on backend endpoint [airflow]
Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun merged PR #44572:
URL: https://github.com/apache/airflow/pull/44572
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org