Skip to content

Fix for Empty except#818

Draft
Andrey1994 wants to merge 1 commit intomasterfrom
finding-autofix-1d5638a7
Draft

Fix for Empty except#818
Andrey1994 wants to merge 1 commit intomasterfrom
finding-autofix-1d5638a7

Conversation

@Andrey1994
Copy link
Copy Markdown
Member

To fix this safely without changing intended functionality, replace the except BaseException: pass with a narrow, documented/logged handler for expected transient data-shape issues.
Best change here: catch AttributeError (and optionally TypeError) for the flaky track payload and log at warning level, then continue loop behavior as before.

In python_package/examples/spotify_dataset_collection/spotify_data_collection.py, edit the inner try/except around current_song_id = track.get('item', {}).get('id') so that:

  • it no longer catches BaseException,
  • it no longer silently passes,
  • it logs a warning via BoardShim.log_message(...).

No imports or dependencies are needed.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
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.

1 participant