Skip to content

Conversation

@KSDaemon
Copy link
Member

@KSDaemon KSDaemon commented Apr 18, 2025

This fix allows to import python modules from files relative to cube.py. See more info and issue description in #8443.

Closes #8443

Check List

  • Tests have been run in packages where changes made if available
  • Linter has been run for changed code
  • Tests for the changes have been added if not covered yet
  • Docs have been added / updated if required

@codecov
Copy link

codecov bot commented Apr 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.27%. Comparing base (940c30f) to head (3c79f20).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9490      +/-   ##
==========================================
- Coverage   80.28%   80.27%   -0.01%     
==========================================
  Files         395      395              
  Lines       97355    97355              
  Branches     2278     2278              
==========================================
- Hits        78158    78150       -8     
- Misses      18889    18897       +8     
  Partials      308      308              
Flag Coverage Δ
cube-backend 57.50% <ø> (ø)
cubesql 83.93% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@KSDaemon KSDaemon marked this pull request as ready for review April 18, 2025 14:44
@KSDaemon KSDaemon requested a review from a team as a code owner April 18, 2025 14:44
@KSDaemon KSDaemon force-pushed the feat/py-imports branch 2 times, most recently from 12c6da6 to dece67e Compare April 23, 2025 13:56
@igorlukanin igorlukanin changed the title feat(backend-native): Allow importing modules from python files within cube.py feat(backend-native): Allow importing modules from python files within cube.py and globals.py Apr 25, 2025
Copy link
Member

@ovr ovr left a comment

Choose a reason for hiding this comment

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

LGTM with minor nit.

@KSDaemon KSDaemon merged commit b8ebf15 into master Apr 30, 2025
81 checks passed
@KSDaemon KSDaemon deleted the feat/py-imports branch April 30, 2025 12:31
marianore-muttdata pushed a commit to MuttData/cube that referenced this pull request Jun 17, 2025
…n `cube.py` and `globals.py` (cube-js#9490)

* feat(backend-native): Allow importing modules from python files within cube.py

* update tests

* Allow importing modules from python files within globals.py

* tests

* another test

* Add docs

* more tests

* extract sys path to fn

---------

Co-authored-by: Igor Lukanin <[email protected]>
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.

Allow to import Python files from cube.py

4 participants