Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions openhexa/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,16 +596,14 @@ def pipelines_list():
if settings.current_workspace is None:
_terminate("No workspace activated", err=True)

workspace_pipelines = (
OpenHexaClient().get_workspace_pipelines(workspace_slug=settings.current_workspace).pipelines.items
)
workspace_pipelines = OpenHexaClient().pipelines(workspace_slug=settings.current_workspace).pipelines.items

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe a nitpick, and it slightly annoys me that I have to do a superfluous .pipelines on this method before getting to the .items 🙂

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I agree with you and wanted to fix this but didn't look far enough to change this.

Thanks for pushing me a bit further, I have found a plugin that does exactly that

if len(workspace_pipelines) == 0:
click.echo(f"No pipelines in workspace {settings.current_workspace}")
return
click.echo("Pipelines:")
for pipeline in workspace_pipelines:
if pipeline.type == "zipFile":
current_version = f"v{pipeline.current_version.version_number}" if pipeline.current_version else "N/A"
current_version = "N/A" if not pipeline.current_version else f"v{pipeline.current_version.version_number}"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This helps with warning in IDE because current version can be None

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Isn't this change identical to what it was before? In general I think if condition is easier to reason about than if not condition.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ok, not a big deal, PyCharm prefers it inverted (I think it does not handle perfectly Optional typing). VS Code seems fine with it so I am reverting this change

@bramj bramj Jun 26, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PyCharm prefers it inverted

Interesting! And weird :p But not a big deal indeed, you can do as you prefer

else:
current_version = "Jupyter notebook"
click.echo(f"* {pipeline.code} - {pipeline.name} ({current_version})")
Expand Down
Loading