Skip to content

[CDF-25127] 🐛Relative path in cdf modules pull #1680

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

doctrino
Copy link
Collaborator

@doctrino doctrino commented Jun 27, 2025

Description

Context In Toolkit, we have a command cdf modules pull that allows you to 'pull' configuration from CDF down to local configurations. For example, I have a transformations which I have changed in the fusion UI, and I want to update the SQL from the transformation. I can do this with the command cdf modules pull modules/my_module/transformations/my_local_config.Transformation.yaml.

Giving a relative path would skip the selection of the resources and it would not be pulled.

Changelog

  • Patch
  • Minor
  • Skip

cdf

Fixed

  • The cdf module pull <path> no longer skips resources when the given path is relative.

templates

No changes.

@@ -96,7 +96,7 @@ def get_resources(
resources = (
resource
for resource in resources
if (resource.source.path == selected or resource.source.path.is_relative_to(selected))
if (resource.source.path == selected or resource.source.path.is_relative_to(selected.absolute()))
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The fix.

@doctrino doctrino marked this pull request as ready for review June 27, 2025 16:10
@doctrino doctrino requested a review from a team as a code owner June 27, 2025 16:10
Copy link

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
19909 15614 78% 60% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
cognite_toolkit/_cdf_tk/data_classes/_built_modules.py 98% 🟢
TOTAL 98% 🟢

updated for commit: d4c3429 by action🐍

@doctrino doctrino enabled auto-merge (squash) June 27, 2025 16:12
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