You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "command-z-z (via GitHub)" <gi...@apache.org> on 2023/02/08 03:12:34 UTC

[GitHub] [airflow] command-z-z opened a new issue, #29414: 'datetime.date' object has no attribute '__module__'

command-z-z opened a new issue, #29414:
URL: https://github.com/apache/airflow/issues/29414

   ### Apache Airflow version
   
   Other Airflow 2 version (please specify below)
   
   ### What happened
   
   When I execute any sql on select statement. I got this error.
   i test this in mysql and postgres, both this error happened.
   
   airflow version 2.5.0
   apache-airflow-providers-mysql      4.0.0
   apache-airflow-providers-postgres   5.4.0
   
   Traceback (most recent call last):
     File "/miniconda3/envs/airflow/lib/python3.8/site-packages/airflow/utils/session.py", line 72, in wrapper
       return func(*args, **kwargs)
     File "/miniconda3/envs/airflow/lib/python3.8/site-packages/airflow/models/taskinstance.py", line 2294, in xcom_push
       XCom.set(
     File "/miniconda3/envs/airflow/lib/python3.8/site-packages/airflow/utils/session.py", line 72, in wrapper
       return func(*args, **kwargs)
     File "/miniconda3/envs/airflow/lib/python3.8/site-packages/airflow/models/xcom.py", line 234, in set
       value = cls.serialize_value(
     File "/miniconda3/envs/airflow/lib/python3.8/site-packages/airflow/models/xcom.py", line 627, in serialize_value
       return json.dumps(value, cls=XComEncoder).encode("UTF-8")
     File "/miniconda3/envs/airflow/lib/python3.8/json/__init__.py", line 234, in dumps
       return cls(
     File "/miniconda3/envs/airflow/lib/python3.8/site-packages/airflow/utils/json.py", line 176, in encode
       return super().encode(o)
     File "/miniconda3/envs/airflow/lib/python3.8/json/encoder.py", line 199, in encode
       chunks = self.iterencode(o, _one_shot=True)
     File "/miniconda3/envs/airflow/lib/python3.8/json/encoder.py", line 257, in iterencode
       return _iterencode(o, 0)
     File "/miniconda3/envs/airflow/lib/python3.8/site-packages/airflow/utils/json.py", line 153, in default
       CLASSNAME: o.__module__ + "." + o.__class__.__qualname__,
   AttributeError: 'datetime.date' object has no attribute '__module__'
   
   ### What you think should happen instead
   
   i dont have free time to see source code.
   Can you help me to solve?
   
   ### How to reproduce
   
   i run the dag code as following:
   
   code in `https://github.com/apache/airflow/blob/providers-postgres/5.4.0/tests/system/providers/postgres/example_postgres.py`
   
   ### Operating System
   
   "Ubuntu"
   
   ### Versions of Apache Airflow Providers
   
   airflow version 2.5.0
   apache-airflow-providers-mysql      4.0.0
   apache-airflow-providers-postgres   5.4.0
   
   ### Deployment
   
   Official Apache Airflow Helm Chart
   
   ### Deployment details
   
   _No response_
   
   ### Anything else
   
   nothing
   
   ### 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.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] boring-cyborg[bot] commented on issue #29414: 'datetime.date' object has no attribute '__module__'

Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on issue #29414:
URL: https://github.com/apache/airflow/issues/29414#issuecomment-1421920573

   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


[GitHub] [airflow] potiuk commented on issue #29414: 'datetime.date' object has no attribute '__module__'

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on issue #29414:
URL: https://github.com/apache/airflow/issues/29414#issuecomment-1575767004

   > @shubham22 I am running my own instance of Airflow, without MWAA. For complicated reasons which I can't go into, it must be v2.5.1. Can you please help me with a workaround for that version, since I am not able to upgrade at this time?
   
   I think where you chose to stick to older version, rather than upgrade, the brutal truth is that you are on your own. Maintainers of airlfow spend awful amount of time and effort - often in their personal time (this is an open-source project at the end) so that they can produce new releases that people can upgrade to. If there are complex reasons that are specific to circumstances of specific users that make it impossible to upgrde to those community prepared releases, then it's really up to the effort of those users who have the circumstances to understand and apply the solution prepared by maintainers on their own. If you consider that we have 10.000 users (we have more), asking the maintainers to spend their time on 10.000 cases like yours in their free time is pretty bad idea. 
   
   If you think that your case is really special that requires not upgrading, the best choice if you cannot fnd time yourself to analyse the relevant PRs and apply them to your case is to find somone you can pay to do the job for you. Otherwise you are asking maintainers to do the job that your businsess needs for free.
   
   If your business has enough justification and funds to pay for it - go for it. If it does not, just follow with the regular releases that are published for anyone to use. You seem to want to have the cake and eat it too at the same time.


-- 
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] eladkal closed issue #29414: 'datetime.date' object has no attribute '__module__'

Posted by "eladkal (via GitHub)" <gi...@apache.org>.
eladkal closed issue #29414: 'datetime.date' object has no attribute '__module__'
URL: https://github.com/apache/airflow/issues/29414


-- 
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] metov-rbi commented on issue #29414: 'datetime.date' object has no attribute '__module__'

Posted by "metov-rbi (via GitHub)" <gi...@apache.org>.
metov-rbi commented on issue #29414:
URL: https://github.com/apache/airflow/issues/29414#issuecomment-1572982177

   In some cases, it is not possible to upgrade to 2.6, for example: https://aws.amazon.com/managed-workflows-for-apache-airflow/
   
   Does anyone know a workaround for cases where 2.5 must be used?


-- 
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] tirkarthi commented on issue #29414: 'datetime.date' object has no attribute '__module__'

Posted by "tirkarthi (via GitHub)" <gi...@apache.org>.
tirkarthi commented on issue #29414:
URL: https://github.com/apache/airflow/issues/29414#issuecomment-1425638406

   I guess this should be resolved by https://github.com/apache/airflow/commit/aefa482051ec249f42095286a0fe4cf0eec1f6f4 in Airflow 2.6 . Simplified reproducer.
   
   Before the above commit : 
   
   ```
   >>> from airflow.utils import json as js
   >>> import json, datetime
   >>> json.dumps({"a": datetime.date.today()}, cls=js.XComEncoder)
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
     File "/usr/lib/python3.10/json/__init__.py", line 238, in dumps
       **kw).encode(obj)
     File "/home/karthikeyan/stuff/python/airflow/airflow/utils/json.py", line 176, in encode
       return super().encode(o)
     File "/usr/lib/python3.10/json/encoder.py", line 199, in encode
       chunks = self.iterencode(o, _one_shot=True)
     File "/usr/lib/python3.10/json/encoder.py", line 257, in iterencode
       return _iterencode(o, 0)
     File "/home/karthikeyan/stuff/python/airflow/airflow/utils/json.py", line 153, in default
       CLASSNAME: o.__module__ + "." + o.__class__.__qualname__,
   AttributeError: 'datetime.date' object has no attribute '__module__'
   ```
   
   Main branch : 
   
   ```
   >>> from airflow.utils import json as js
   >>> import json, datetime
   >>> json.dumps({"a": datetime.date.today()}, cls=js.XComEncoder)
   '{"a": {"__classname__": "datetime.date", "__version__": 1, "__data__": "2023-02-10"}}'
   ```


-- 
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] eladkal commented on issue #29414: 'datetime.date' object has no attribute '__module__'

Posted by "eladkal (via GitHub)" <gi...@apache.org>.
eladkal commented on issue #29414:
URL: https://github.com/apache/airflow/issues/29414#issuecomment-1425898715

   In that case I'm closing this one as fixed in main and expected to be release in 2.6


-- 
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] Ladvien commented on issue #29414: 'datetime.date' object has no attribute '__module__'

Posted by "Ladvien (via GitHub)" <gi...@apache.org>.
Ladvien commented on issue #29414:
URL: https://github.com/apache/airflow/issues/29414#issuecomment-1573906354

   I'm going to second @metov-rbi, we have _just_ setup AWS' MWAA (feel free to throw stones, company's choice), we don't have an option to upgrade to 2.6.
   
   https://docs.aws.amazon.com/mwaa/latest/userguide/airflow-versions.html


-- 
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] metov-rbi commented on issue #29414: 'datetime.date' object has no attribute '__module__'

Posted by "metov-rbi (via GitHub)" <gi...@apache.org>.
metov-rbi commented on issue #29414:
URL: https://github.com/apache/airflow/issues/29414#issuecomment-1574044776

   @shubham22 I am running my own instance of Airflow, without MWAA. For complicated reasons which I can't go into, it must be v2.5.1. Can you please help me with a workaround for that version, since I am not able to upgrade at this time?


-- 
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] shubham22 commented on issue #29414: 'datetime.date' object has no attribute '__module__'

Posted by "shubham22 (via GitHub)" <gi...@apache.org>.
shubham22 commented on issue #29414:
URL: https://github.com/apache/airflow/issues/29414#issuecomment-1574042406

   @metov-rbi @Ladvien - for information regarding upcoming MWAA releases and features, such as support for v2.6, please reach out to your AWS Account Manager.
   
   


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