feat: Add lots of methods to OpenHexaClient#281
Conversation
| 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}" |
There was a problem hiding this comment.
This helps with warning in IDE because current version can be None
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
PyCharm prefers it inverted
Interesting! And weird :p But not a big deal indeed, you can do as you prefer
| """The countries of the workspace.""" | ||
| try: | ||
| return OpenHexaClient().get_countries(workspace_slug=self.slug).workspace.countries | ||
| return OpenHexaClient().workspace(slug=self.slug).workspace.countries |
There was a problem hiding this comment.
Let's use a more generic query
bramj
left a comment
There was a problem hiding this comment.
@yolanfery Nice exploration! What do you think about this approach? I think it strikes a good balance between the manual and generated.
I would add methods for the datasets as well, what do you think?
| 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}" |
There was a problem hiding this comment.
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.
| workspace_pipelines = ( | ||
| OpenHexaClient().get_workspace_pipelines(workspace_slug=settings.current_workspace).pipelines.items | ||
| ) | ||
| workspace_pipelines = OpenHexaClient().pipelines(workspace_slug=settings.current_workspace).pipelines.items |
There was a problem hiding this comment.
Maybe a nitpick, and it slightly annoys me that I have to do a superfluous .pipelines on this method before getting to the .items 🙂
There was a problem hiding this comment.
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
It feels nice, yes
Done |
I have checked that in the toolbox we technically never use SDK (we have used it in past to define connection type DHIS2, IASO etc and derive client instantiation from it) but now clients are changed to be instantiated explicitly from credentials. |
Yes definitely ! Thanks for checking |

ariadne-codegen