Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dont override global warning #1350

Merged
merged 2 commits into from
Nov 20, 2024

Conversation

kevinjqliu
Copy link
Contributor

When looking into #1346, I was confused by why the datetime.datetime.utcfromtimestamp warning only errored for the branch and not for the main branch.
Turns out there's a bug in the _deprecation_warning code where all warnings are suppressed when displaying a deprecation warning. The datetime.datetime.utcfromtimestamp warning is suppressed in the main branch because the test also triggered other deprecation warnings. When those deprecation warnings are removed in the feature branch, the only other warning is shown and causes the test to fail.

This PR changes _deprecation_warning to temporarily override warning handling.

@kevinjqliu
Copy link
Contributor Author

Expecting this to surface the issue with pyspark using datetime.datetime.utcfromtimestamp and fail CI

@kevinjqliu kevinjqliu requested a review from Fokko November 20, 2024 20:29
Copy link
Contributor

@Fokko Fokko left a comment

Choose a reason for hiding this comment

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

Good catch! I like the context manager, thanks for fixing this!

@kevinjqliu kevinjqliu merged commit 8e0e6a1 into apache:main Nov 20, 2024
7 checks passed
@kevinjqliu kevinjqliu deleted the kevinjqliu/fix-deprecation-warning branch November 20, 2024 20:46
This was referenced Nov 25, 2024
sungwy pushed a commit to sungwy/iceberg-python that referenced this pull request Dec 7, 2024
* dont override global

* add back warning filter
sungwy pushed a commit to sungwy/iceberg-python that referenced this pull request Dec 7, 2024
* dont override global

* add back warning filter
JE-Chen pushed a commit to JE-Chen/iceberg-python that referenced this pull request Dec 23, 2024
* dont override global

* add back warning filter
sungwy pushed a commit to sungwy/iceberg-python that referenced this pull request Dec 24, 2024
* dont override global

* add back warning filter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants