-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
BUG: fix float string literal issues #624
Conversation
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.
I have not tried to fathom why unit tests didn't catch that one, and I can't find time to do that now. Similarly, I would have to spend more time than I have now to set up a numpy2 testbed, and so I have not actually ascertained that f-string interpolation will produce valid SQL literals. Since that seems very plausible, though, I will approve, but I am grateful if someone will do some stress testing of fix.
We have opted in legacy printing in the test configs, so this all got effectively turned off for all unit tests, initially as a workaround, but apparently it had unintended consequences I'm working on finding a fix that actually works for all the version and will push a commit for that, hopefully shortly. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #624 +/- ##
==========================================
- Coverage 82.31% 82.31% -0.01%
==========================================
Files 72 72
Lines 7431 7429 -2
==========================================
- Hits 6117 6115 -2
Misses 1314 1314 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
OK, so with this latest commit I made a slight change, but I don't think it's making anything worse. Prior this we had the repr as Please re-review to say whether you are OK with this, or prefer if I find some other way to keep exactly what we had before. |
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.
With the caveats from my last review (plus I have not thought about whether DALQuery.__repr__
changes might break code): Let's go.
FWIW, I'm on np 2.0+ in all my dev envs (and this PR gets rid of the legacy print workaround, too), and we do have many of the notebooks/astroquery/etc CI, so those provide some actual testsbeds. I had a quickrun of their tests with this branch and it looked all OK, but I'll keep an eye on CI statuses for the longer running version. |
This logic was introduced in the big registry overhaul PR #289, and I see no review discussion for this part of the code.
Looking at it now, I think f-strings should be powerful enough when generating the SQL string. If not, we will definitely need some use case coverage in the tests, too.
First commit fixes #623, but I think the cleanup in the second commit should work, too.
The changes in numpy printoptions in the tests ensure that we indeed trigger the bug (it does have ample test coverage with existing tests). I expect some other places may be affected and will rely on CI to smoke out the version dependencies of them and will see whether they are bugs or the fixes can be included here, too.