You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/01/03 17:04:51 UTC

[GitHub] [airflow] frodo2000 opened a new issue #20636: Failed to serialize DAG name': 'str' object has no attribute '__module__'

frodo2000 opened a new issue #20636:
URL: https://github.com/apache/airflow/issues/20636


   ### Apache Airflow version
   
   2.2.3 (latest released)
   
   ### What happened
   
   After upgrade to 2.2.3 one of DAGs could not be serialized due to the following error;
   
   Broken DAG: [/opt/airflow/dags/ImamRefresh_DAG.py] Traceback (most recent call last):
     File "/home/airflow/airflow_venv/lib64/python3.6/site-packages/airflow/serialization/serialized_objects.py", line 574, in serialize_operator
       serialize_op['params'] = cls._serialize_params_dict(op.params)
     File "/home/airflow/airflow_venv/lib64/python3.6/site-packages/airflow/serialization/serialized_objects.py", line 447, in _serialize_params_dict
       if f'{v.__module__}.{v.__class__.__name__}' == 'airflow.models.param.Param':
   AttributeError: 'str' object has no attribute '__module__'
   
   During handling of the above exception, another exception occurred:
   
   Traceback (most recent call last):
     File "/home/airflow/airflow_venv/lib64/python3.6/site-packages/airflow/serialization/serialized_objects.py", line 935, in to_dict
       json_dict = {"__version": cls.SERIALIZER_VERSION, "dag": cls.serialize_dag(var)}
     File "/home/airflow/airflow_venv/lib64/python3.6/site-packages/airflow/serialization/serialized_objects.py", line 847, in serialize_dag
       raise SerializationError(f'Failed to serialize DAG {dag.dag_id!r}: {e}')
   airflow.exceptions.SerializationError: Failed to serialize DAG 'ImamRefresh_DAG': 'str' object has no attribute '__module__'
   
   ### What you expected to happen
   
   _No response_
   
   ### How to reproduce
   
   Problem is caused by user operator that contains self.params variable. At least documentation for developers should be extended by that informaiton.
   
   ### Operating System
   
   RHEL 8
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Virtualenv installation
   
   ### Deployment details
   
   _No response_
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
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



[GitHub] [airflow] potiuk closed issue #20636: Failed to serialize DAG name': 'str' object has no attribute '__module__'

Posted by GitBox <gi...@apache.org>.
potiuk closed issue #20636:
URL: https://github.com/apache/airflow/issues/20636


   


-- 
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



[GitHub] [airflow] frodo2000 commented on issue #20636: Failed to serialize DAG name': 'str' object has no attribute '__module__'

Posted by GitBox <gi...@apache.org>.
frodo2000 commented on issue #20636:
URL: https://github.com/apache/airflow/issues/20636#issuecomment-1033563265


   > I am facing the same error message with the airflow version 2.2.3. @frodo2000, did you find a workaround for this issue?
   
   I have change params variable name in my operator. Then DAG was compiled 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



[GitHub] [airflow] gitruhul commented on issue #20636: Failed to serialize DAG name': 'str' object has no attribute '__module__'

Posted by GitBox <gi...@apache.org>.
gitruhul commented on issue #20636:
URL: https://github.com/apache/airflow/issues/20636#issuecomment-1076087065


   I have my custom operators but no variables with the name params. 
   
   But getting this error occasionally:
   
   `Broken DAG: [/opt/airflow/dags/SAMPLE_DAG_USING_PLUGINS.py] Traceback (most recent call last):
     File "/home/airflow/.local/lib/python3.7/site-packages/airflow/serialization/serialized_objects.py", line 578, in serialize_operator
       serialize_op['params'] = cls._serialize_params_dict(op.params)
     File "/home/airflow/.local/lib/python3.7/site-packages/airflow/serialization/serialized_objects.py", line 451, in _serialize_params_dict
       if f'{v.__module__}.{v.__class__.__name__}' == 'airflow.models.param.Param':
   AttributeError: 'dict' object has no attribute '__module__'
   
   During handling of the above exception, another exception occurred:
   
   Traceback (most recent call last):
     File "/home/airflow/.local/lib/python3.7/site-packages/airflow/serialization/serialized_objects.py", line 939, in to_dict
       json_dict = {"__version": cls.SERIALIZER_VERSION, "dag": cls.serialize_dag(var)}
     File "/home/airflow/.local/lib/python3.7/site-packages/airflow/serialization/serialized_objects.py", line 851, in serialize_dag
       raise SerializationError(f'Failed to serialize DAG {dag.dag_id!r}: {e}')
   airflow.exceptions.SerializationError: Failed to serialize DAG 'SAMPLE_DAG_USING_PLUGINS': 'dict' object has no attribute '__module__'`


-- 
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



[GitHub] [airflow] potiuk commented on issue #20636: Failed to serialize DAG name': 'str' object has no attribute '__module__'

Posted by GitBox <gi...@apache.org>.
potiuk commented on issue #20636:
URL: https://github.com/apache/airflow/issues/20636#issuecomment-1004234689


   Could you please make a PR with proposed documentation update? it's next to impossible to foreseen what other fields people could add to the operators of their own, which would prevent from addig any parameters. 
   
   But if you think about a place where some warning like that could be added to the docuementation it would be great. Airflow is created by almost 1900 contributors, so you can become easily one of them if you provide this.
   
   This is super-easy - just go to the right docuementation on https://airflwo.apache.org and use "Suggest a change on this page" button at bottom right  - it will open Pull Request for the right documentation page. I think, you are one of the best people to add this kind of documentation update - you suffered from it, so you are likely to find the right place and formulate it in the way that other users who might have the same problem woudl search for help.
   
   Looking forward to your PR.


-- 
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



[GitHub] [airflow] potiuk edited a comment on issue #20636: Failed to serialize DAG name': 'str' object has no attribute '__module__'

Posted by GitBox <gi...@apache.org>.
potiuk edited a comment on issue #20636:
URL: https://github.com/apache/airflow/issues/20636#issuecomment-1004234689


   Could you please make a PR with proposed documentation update? it's next to impossible to foresee what other fields people could add to the operators of their own, which would prevent from addig any parameters. 
   
   But if you think about a place where some warning like that could be added to the docuementation it would be great. Airflow is created by almost 1900 contributors, so you can become easily one of them if you provide this.
   
   This is super-easy - just go to the right docuementation on https://airflow.apache.org and use "Suggest a change on this page" button at bottom right  - it will open Pull Request for the right documentation page. I think, you are one of the best people to add this kind of documentation update - you suffered from it, so you are likely to find the right place and formulate it in the way that other users who might have the same problem woudl search for help.
   
   Looking forward to your PR.


-- 
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



[GitHub] [airflow] juferafo commented on issue #20636: Failed to serialize DAG name': 'str' object has no attribute '__module__'

Posted by GitBox <gi...@apache.org>.
juferafo commented on issue #20636:
URL: https://github.com/apache/airflow/issues/20636#issuecomment-1033535102


   I am facing the same error message with the airflow version 2.2.3. @frodo2000, did you find a workaround for this 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



[GitHub] [airflow] potiuk edited a comment on issue #20636: Failed to serialize DAG name': 'str' object has no attribute '__module__'

Posted by GitBox <gi...@apache.org>.
potiuk edited a comment on issue #20636:
URL: https://github.com/apache/airflow/issues/20636#issuecomment-1004234689


   Could you please make a PR with proposed documentation update? it's next to impossible to foresee what other fields people could add to the operators of their own, which would prevent from addig any parameters. 
   
   But if you think about a place where some warning like that could be added to the docuementation it would be great. Airflow is created by almost 1900 contributors, so you can become easily one of them if you provide this.
   
   This is super-easy - just go to the right docuementation on https://airflow.apache.org/docs/ and use "Suggest a change on this page" button at bottom right  - it will open Pull Request for the right documentation page. I think, you are one of the best people to add this kind of documentation update - you suffered from it, so you are likely to find the right place and formulate it in the way that other users who might have the same problem woudl search for help.
   
   Looking forward to your PR.


-- 
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



[GitHub] [airflow] potiuk edited a comment on issue #20636: Failed to serialize DAG name': 'str' object has no attribute '__module__'

Posted by GitBox <gi...@apache.org>.
potiuk edited a comment on issue #20636:
URL: https://github.com/apache/airflow/issues/20636#issuecomment-1004234689


   Could you please make a PR with proposed documentation update? it's next to impossible to foresee what other fields people could add to the operators of their own, which would prevent from addig any parameters. 
   
   But if you think about a place where some warning like that could be added to the docuementation it would be great. Airflow is created by almost 1900 contributors, so you can become easily one of them if you provide this.
   
   This is super-easy - just go to the right docuementation on https://airflwo.apache.org and use "Suggest a change on this page" button at bottom right  - it will open Pull Request for the right documentation page. I think, you are one of the best people to add this kind of documentation update - you suffered from it, so you are likely to find the right place and formulate it in the way that other users who might have the same problem woudl search for help.
   
   Looking forward to your PR.


-- 
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



[GitHub] [airflow] boring-cyborg[bot] commented on issue #20636: Failed to serialize DAG name': 'str' object has no attribute '__module__'

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on issue #20636:
URL: https://github.com/apache/airflow/issues/20636#issuecomment-1004228288


   Thanks for opening your first issue here! Be sure to follow the issue template!
   


-- 
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