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

[XMatch] fix: upload of two local tables is now possible #3116

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

ManonMarchand
Copy link
Member

@ManonMarchand ManonMarchand commented Oct 4, 2024

Hello astroquery 🙂

In the files dictionary sent to XMatch, the second table was written over the first one, resulting in a confusing "missing cat1" error even if the user did give a cat1. This fixes #3115 , closes #1687 and closes #1786

I did not add a remote test, only a local one. Is it ok?

Copy link

codecov bot commented Oct 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.38%. Comparing base (ba9350a) to head (5c4a02b).
Report is 121 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3116      +/-   ##
==========================================
+ Coverage   67.36%   67.38%   +0.02%     
==========================================
  Files         233      233              
  Lines       18415    18417       +2     
==========================================
+ Hits        12405    12411       +6     
+ Misses       6010     6006       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ManonMarchand ManonMarchand changed the title fix: upload of two local tables is now possible [XMatch] fix: upload of two local tables is now possible Oct 4, 2024
@ManonMarchand ManonMarchand requested a review from bsipocz October 4, 2024 10:18
@bsipocz bsipocz added the bug label Oct 4, 2024
@bsipocz bsipocz added this to the v0.4.8 milestone Oct 4, 2024
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.

Thank you for the fix!

Local only tests for this is fully reasonable.

fp = StringIO()
cat.write(fp, format='ascii.csv')
fp.seek(0)
kwargs['files'].update({catstr: (f'cat{cat_index}.csv', fp.read())})
Copy link
Member

Choose a reason for hiding this comment

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

I suppose you don't have to regenerate cat{cat_index} here, but reuse it from L127 as f'{catstr}', however this is a ridiculous level of nitpicking, so I'll just go ahead and merge the fix instead :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, yes it was better than what I did. Don't hesitate to change something if it happens again in an other PR, I won't be offended 🙂

@bsipocz bsipocz merged commit 9faae2b into astropy:main Oct 4, 2024
13 checks passed
@ManonMarchand ManonMarchand deleted the fix-xmatch-two-local-files branch October 10, 2024 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants