Skip to content

Better error message when serializing callable without name#31778

Merged
potiuk merged 1 commit into
apache:mainfrom
potiuk:better-error-when-serializing-callable-with-no-name-attribute
Jun 7, 2023
Merged

Better error message when serializing callable without name#31778
potiuk merged 1 commit into
apache:mainfrom
potiuk:better-error-when-serializing-callable-with-no-name-attribute

Conversation

@potiuk

@potiuk potiuk commented Jun 7, 2023

Copy link
Copy Markdown
Member

When Callable without __name__ got serialized, the error message was pretty cryptic: AttributeError: __name__. Did you mean: '__ne__'? without printing what the failing type is.

This PR adds a more meaningful message

Related to #31753, #31499


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

When Callable without `__name__` got serialized, the error message was
pretty cryptic: `AttributeError: __name__. Did you mean: '__ne__'?`
without printing what the failing type is.

This PR adds a more meaningful message

Related to apache#31753, apache#31499
@potiuk
potiuk force-pushed the better-error-when-serializing-callable-with-no-name-attribute branch from fdfadb8 to 353719d Compare June 7, 2023 18:34

@hussein-awala hussein-awala left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@potiuk potiuk added this to the Airflow 2.6.2 milestone Jun 7, 2023
@potiuk
potiuk merged commit 727db07 into apache:main Jun 7, 2023
@potiuk
potiuk deleted the better-error-when-serializing-callable-with-no-name-attribute branch June 7, 2023 19:25
@eladkal eladkal added the type:misc/internal Changelog: Misc changes that should appear in change log label Jun 8, 2023
@eladkal eladkal modified the milestones: Airflow 2.6.2, Airflow 2.7.0 Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:serialization type:misc/internal Changelog: Misc changes that should appear in change log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants