SparkKubernetesOperator is not working when we are passing YAML string #34993
Replies: 6 comments 2 replies
-
Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval. |
Beta Was this translation helpful? Give feedback.
-
This operation transform into the python objects, e.g. it could be dict, lists, and others. Could you provide a bit more details, e.g. example of your tasks/dags |
Beta Was this translation helpful? Give feedback.
-
I am just creating a spark job. When I pass file name as application_file = "pipeline.yaml" in SparkKubernetesOperator, it works fine. But when I pass the yaml as string e.g. application_file = load_template_v1(), it start to fail. I am getting following error - |
Beta Was this translation helpful? Give feedback.
-
It is working fine with older version of airflow. |
Beta Was this translation helpful? Give feedback.
-
That is not a part of Airflow core, this part of Community provider According provided stacktrace, you have a problem with That mean previously it accidentally work as undocumented feature, however stop working after some release, I assume after this one #29977. Feel free to open a feature request, or if you know how to add this functionality feel free to open a PR directly: |
Beta Was this translation helpful? Give feedback.
-
however [docstring] said that it expected path to the YAML/JSON (as part of Airflow templates) or YAML/JSON string. So, we can pass YAML string. Initially we are passing YAML file path and in second option, we are passing file content means YAML string. So, it was not accidental thing. Would you please share the community link, where I should ask this question? |
Beta Was this translation helpful? Give feedback.
-
Apache Airflow version
2.7.2
What happened
Currently I am using -
Python version: 3.8.18
Airflow version: 2.7.1v (on K8S)
When we run SparkKubernetesOperator function with YAML file path, it work fine. But when we are running the same after reading the YAML file, it fails.
Example -
What you think should happen instead
It should launch Spark Operator successfully.
How to reproduce
Instead of passing YAML file, pass the content of file.
Operating System
K8S
Versions of Apache Airflow Providers
Python version: 3.8.18
Airflow version: 2.7.1
Deployment
Official Apache Airflow Helm Chart
Deployment details
HELM
Python version: 3.8.18
Airflow version: 2.7.1
Anything else
No
Are you willing to submit PR?
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions