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

Now passing strings to mimetypes.guess_extension. #553

Merged
merged 1 commit into from
Jun 27, 2024

Conversation

msdemlei
Copy link
Contributor

@msdemlei msdemlei commented Jun 12, 2024

Also changing the default for images to .img (from None).

This is supposed to address bug #552.

Fixes #552

@bsipocz bsipocz added this to the v1.6 milestone Jun 12, 2024
@msdemlei msdemlei force-pushed the fix-extension-derivation branch 2 times, most recently from c0ab930 to 16bc54f Compare June 13, 2024 07:07
@msdemlei
Copy link
Contributor Author

So, I think the remaining failure is unrelated (a fluke?). From my point of view, this is ready to go.

pyvo/dal/sia.py Outdated
@@ -903,7 +903,7 @@ def suggest_dataset_basename(self):
out = re.sub(r'\s+', '_', out.strip())
return out

def suggest_extension(self, *, default=None):
def suggest_extension(self, *, default='img'):
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious why img? I've noticed same assumption in suggest_dataset_basename.

@msdemlei
Copy link
Contributor Author

msdemlei commented Jun 17, 2024 via email

@msdemlei
Copy link
Contributor Author

There is "dat" as a non-informative default extension elsewhere in pyvo, so that's what I'm going for now.

@msdemlei
Copy link
Contributor Author

(test failures were a glitch on a remote service)

Copy link
Member

@bsipocz bsipocz left a comment

Choose a reason for hiding this comment

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

Can we have a test for original_row, and its setter method? As far as I see it doesn't come up with any of the tests.

note the table row this DatalinkResults instance was generated
from.

This is mostly for pyVO-internal use.
Copy link
Member

Choose a reason for hiding this comment

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

given this, should this be prepended with an _?

@bsipocz
Copy link
Member

bsipocz commented Jun 27, 2024

OK, looking at the other PRs and discussions, and the commit history here, I think that the original_row related changes are added here by mistake in the very last commit iteration.

So, I'll make a backup of the current branch, but then will go ahead and remove those changes from this PR and merge it as the rest are fully finished with test and addressed review.

Also changing the default extension to .dat (from None).

Also, whatever was originally implementing mime2extension did not include
the leading dot that mimetypes includes.  We are doing away with that, too.

This is supposed to address bug astropy#552.
@bsipocz
Copy link
Member

bsipocz commented Jun 27, 2024

The backup commit is here: e2cdd91

@bsipocz bsipocz merged commit 7020a9f into astropy:main Jun 27, 2024
10 checks passed
@bsipocz
Copy link
Member

bsipocz commented Jun 27, 2024

Thank you @msdemlei!

(I mark this for backport, in case we have 1.5.3 coming out sooner than 1.6)

@bsipocz bsipocz modified the milestones: v1.6, v1.5.3 Jun 27, 2024
@msdemlei
Copy link
Contributor Author

msdemlei commented Jun 28, 2024 via email

bsipocz added a commit that referenced this pull request Oct 14, 2024
Now passing strings to mimetypes.guess_extension.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cachedataset extension derivation broken
3 participants