-
Notifications
You must be signed in to change notification settings - Fork 31
Fix for the PS1 metadata query failure #226
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
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.
Pull request overview
This PR addresses sporadic Pan-STARRS metadata query failures by implementing a local caching mechanism. When the server returns incomplete metadata (missing 'description' field), the code falls back to a locally cached version of the metadata table.
Key Changes:
- Implements caching of successfully retrieved PS1 metadata to local CSV files
- Adds fallback mechanism to use cached metadata when server returns incomplete data
- Updates .gitignore to exclude generated cache files from version control
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| frb/surveys/panstarrs.py | Adds try-except block to cache metadata on successful queries and fallback to cached version on KeyError when server returns incomplete data |
| .gitignore | Excludes generated PS1 metadata CSV cache files from version control |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
profxj
left a comment
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.
thanks!
Is a test tickling this?
If not, can we add one?
|
Added a number of assertions to the Pan-STARRS test now to hopefully catch this issue. I've checked it works locally with Pytest. |
PS1 query fails sporadically. i.e., 1 out of every 5 searches at the same coordinate (and search radius) runs into this error. This is definitely a server-side issue.
The error occurs when trying to download table metadata from Pan-STARRS. For some reason, only these metadata entries are affected:
[astrometryCorrectionFlag', 'pmra', 'pmdec', 'pmraErr', 'pmdecErr']. When this error occurs, instead of returning a full dict of metadata for those entries, the server returns only two values:nameanddb_type. Our function is requestingname, type, description.I suggest storing the metadata table locally upon a successful query and just re-using the local table whenever the server barfs. This way, the user can still access those metadata entries instead of seeing None.