Skip to content

Conversation

@SunilSimha
Copy link
Collaborator

@SunilSimha SunilSimha commented Jan 5, 2026

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: name and db_type. Our function is requesting name, 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.

Copy link

Copilot AI left a 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.

Copy link
Contributor

@profxj profxj left a 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?

@SunilSimha
Copy link
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.

@SunilSimha SunilSimha requested a review from profxj January 6, 2026 15:49
@profxj profxj merged commit 9a949bc into main Jan 6, 2026
0 of 8 checks passed
@profxj profxj deleted the ps1_hotfix branch January 6, 2026 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants