Skip to content

fix: handle empty block_number gracefully#10

Merged
coko7 merged 2 commits intocoko7:mainfrom
parisgianluca:fix/9-handle-empty-block-number
Mar 24, 2026
Merged

fix: handle empty block_number gracefully#10
coko7 merged 2 commits intocoko7:mainfrom
parisgianluca:fix/9-handle-empty-block-number

Conversation

@parisgianluca
Copy link
Copy Markdown
Contributor

Summary

  • Changed block_number field from required (i32) to optional (Option<i32>) to handle missing data on the source website
  • Updated fetch_block_number to return None instead of failing when the field is empty or contains no digits
  • Follows the same pattern already established for similar optional fields (cost, power, counter)

Test plan

  • cargo check passes
  • Tested scraping pack 569115 (OP-15) — successfully fetched all 196 cards
  • Verified card OP15-096 now has "block_number": null in the JSON output instead of causing the entire scrape to fail

Fixes #9

Made with Cursor

parisgianluca and others added 2 commits March 23, 2026 14:06
Change block_number from required (i32) to optional (Option<i32>)
to handle cases where the source website has missing data.

This follows the same pattern used for other optional numeric fields
(cost, power, counter) in the codebase.

Fixes coko7#9

Made-with: Cursor
@coko7 coko7 merged commit 225925e into coko7:main Mar 24, 2026
5 checks passed
@coko7
Copy link
Copy Markdown
Owner

coko7 commented Mar 24, 2026

Thank you!

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.

[Bug] Scraping fails for pack 569115 (OP-15): "card.block_number is empty!" on OP15-096

2 participants