-
Notifications
You must be signed in to change notification settings - Fork 57
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
add AsdfDeprecationWarning to AsdfFile.blocks #1336
add AsdfDeprecationWarning to AsdfFile.blocks #1336
Conversation
a186f6d
to
7a1b00a
Compare
The error in asdf-astropy is interesting and may be a bug in asdf. The tests triggered by the fits schema: It seems to me that finding a converter should prevent the use of the type similar to what is done during serialization: Lines 256 to 266 in da32b40
but no such check is done: Lines 558 to 562 in da32b40
|
This is irrelevant as |
That all sounds good. I opened a PR to fix the issue as it looks like a bug in asdf where it shouldn't be calling reserve_blocks on an object that will be serialized with a converter. I looked into ignoring the warnings for specific astropy tests and I think the following should suffice if we're happy with the format of the warnings: |
7a1b00a
to
e9967f9
Compare
Public use of the block manager will be removed in ASDF 3.0 to allow for major changes to it's API. It is currently used by the legacy extensions (also removed in ASDF 3.0). The new converters do not currently have block storage access. Fixes issue asdf-format#1335
e9967f9
to
a84094d
Compare
8d33b46
to
580b9de
Compare
@@ -136,7 +136,7 @@ commands_pre= | |||
pip install -r {envtmpdir}/requirements.txt | |||
pip freeze | |||
commands= | |||
pytest astropy/astropy/io/misc/asdf --open-files --run-slow --remote-data | |||
pytest astropy/astropy/io/misc/asdf --open-files --run-slow --remote-data -W "ignore:The property AsdfFile.blocks has been deprecated:asdf.exceptions.AsdfDeprecationWarning:asdf.asdf:661" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@WilliamJamieson What are your thoughts on this as a way to keep our downstream CI from failing until astropy is updated to ignore this new deprecation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be out of scope, but as we add these deprecation warnings, we should create a distinct page in the docs which calls out all of them. We may want to include notes on timelines for removal (maybe link to mitigation strategies too).
def test_blocks_deprecated(): | ||
af = AsdfFile() | ||
with pytest.deprecated_call(): | ||
af.blocks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion, more than a request maybe we should have a test_deprecated.py
for this. We are going to have a bunch more deprecation warnings that we are going to have to test. It would be nice if those were all in one spot so that we can strip them out when they are done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent idea. I opened an issue to track this:
#1346
Public use of the block manager will be removed in ASDF 3.0 to allow for major changes to it's API. It is currently used by the legacy extensions (also removed in ASDF 3.0). The new converters do not currently have block storage access.
To provide a sense for possible breaking changes to the block manager and block storage access, the current experimental branch that adds block storage access to converters passes all block manager calls through the serialization context:
4f62156
Adding block storage access to the converter is scheduled for ASDF 3.0 and the API and implementation details are not yet finalized.
Fixes issue #1335