Skip to content

Remove importlib_metadata fallback import#2545

Merged
rashidakanchwala merged 1 commit intomainfrom
refactor/remove-importlib-metadata-fallback
Jan 7, 2026
Merged

Remove importlib_metadata fallback import#2545
rashidakanchwala merged 1 commit intomainfrom
refactor/remove-importlib-metadata-fallback

Conversation

@rashidakanchwala
Copy link
Copy Markdown
Contributor

Description

  • Removed unnecessary try/except block for importing version from importlib_metadata fallback
  • Simplified import to use importlib.metadata.version directly alongside PackageNotFoundError

Context

The importlib.metadata module has been part of Python's standard library since Python 3.8. The fallback to importlib_metadata is no longer needed for the supported Python versions in this project.

Changes

  • Consolidated imports in package/kedro_viz/api/rest/utils.py
  • Removed try/except block for backwards compatibility

QA notes

Checklist

  • Read the contributing guidelines
  • Opened this PR as a 'Draft Pull Request' if it is work-in-progress
  • Updated the documentation to reflect the code changes
  • Added new entries to the RELEASE.md file
  • Added tests to cover my changes

Signed-off-by: rashidakanchwala <rashida_kanchwala@mckinsey.com>
@rashidakanchwala rashidakanchwala requested review from SajidAlamQB and merelcht and removed request for merelcht January 6, 2026 18:33
Copy link
Copy Markdown
Contributor

@ravi-kumar-pilla ravi-kumar-pilla left a comment

Choose a reason for hiding this comment

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

LGTM 👍 ... Thank you

@rashidakanchwala rashidakanchwala merged commit 2a0f85b into main Jan 7, 2026
49 checks passed
@rashidakanchwala rashidakanchwala deleted the refactor/remove-importlib-metadata-fallback branch January 7, 2026 09:14
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