Skip to content

DM-54302: Fall back to read the raw fits when json is not available#370

Merged
hsinfang merged 1 commit intomainfrom
tickets/DM-54302
Mar 16, 2026
Merged

DM-54302: Fall back to read the raw fits when json is not available#370
hsinfang merged 1 commit intomainfrom
tickets/DM-54302

Conversation

@hsinfang
Copy link
Copy Markdown
Collaborator

@hsinfang hsinfang commented Mar 5, 2026

No description provided.

@hsinfang hsinfang requested a review from kherner March 5, 2026 21:48
Comment thread python/shared/raw.py Outdated
@hsinfang hsinfang force-pushed the tickets/DM-54302 branch 2 times, most recently from 3a02ee8 to 79fae53 Compare March 13, 2026 18:43
Comment thread python/shared/raw.py
) from e
except Exception as e:
raise RuntimeError(
f"Unable to retrieve group ID from {image}: {e}"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The {e} should not be necessary if you're chaining the exception. What's the reason for catching and wrapping Exception, though?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

My thought was to just add a clearer error message, but yes it's not necessary.

@kfindeisen
Copy link
Copy Markdown
Member

Can any of this be tested in test_raw.py?

@hsinfang
Copy link
Copy Markdown
Collaborator Author

Good idea -- thank you; a test is added.

I needed to adjust the implementation to make it testable with moto. My original implementation used read_basic_metadata_from_file from astro_metadata_translator, which internally uses fsspec/s3fs with async operations. This triggers an incompatibility with moto's S3 mocking (moto has incomplete async support). I changed to a simpler implementation without fsspec and then it works with moto.

@hsinfang hsinfang merged commit 40eb591 into main Mar 16, 2026
11 checks passed
@hsinfang hsinfang deleted the tickets/DM-54302 branch March 16, 2026 20:20
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