Conversation
There was a problem hiding this comment.
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
approved these changes
Jan 5, 2026
Contributor
profxj
left a comment
There was a problem hiding this comment.
thanks!
Is a test tickling this?
If not, can we add one?
Collaborator
Author
|
Added a number of assertions to the Pan-STARRS test now to hopefully catch this issue. I've checked it works locally with Pytest. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.