Skip to content

Fix for Empty except#818

Merged
Andrey1994 merged 1 commit into
masterfrom
finding-autofix-1d5638a7
Apr 26, 2026
Merged

Fix for Empty except#818
Andrey1994 merged 1 commit into
masterfrom
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>
@Andrey1994 Andrey1994 marked this pull request as ready for review April 26, 2026 22:34
@Andrey1994 Andrey1994 merged commit 8b6f97e into master Apr 26, 2026
37 of 38 checks passed
@Andrey1994 Andrey1994 deleted the finding-autofix-1d5638a7 branch May 9, 2026 15:27
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