Hjm/doc 1.x to 2.x - #83
Open
HectorJM2018Cosmo wants to merge 6 commits into
Open
Conversation
HectorJM2018Cosmo
requested review from
lalepee
and
a lite review from Copilot
August 10, 2026 09:44
There was a problem hiding this comment.
Pull request overview
Updates the tutorial documentation and example scripts to align with the CoAL / csm-data 2.x API surface (notably the new cosmotech_api.apis.* wrappers and Parquet support), and adjusts CLI/tutorial workflows from scenario-run concepts to runner/run data concepts.
Changes:
- Added a Parquet datastore tutorial example and referenced it from the datastore docs.
- Migrated CosmoTech API tutorial scripts/docs from legacy helper functions (
get_api_client, workspace/runner helpers, TDL helpers) toConnection+WorkspaceApi/RunnerApi/DatasetApiwrappers. - Updated
csm-datatutorial scripts and integration JSON to userun-load-data/ runner terminology and simplified flags.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tutorial/datastore/parquet_files.py | New tutorial script demonstrating loading/exporting Parquet with the datastore |
| tutorial/csm-data/run_load_data.bash | Updates CLI example invocation (removes older flags) |
| tutorial/csm-data/csm_orc_integration.json | Updates ORC integration step IDs/commands for runner data |
| tutorial/csm-data/complete_pipeline.bash | Updates pipeline script to the new run-load-data invocation shape |
| tutorial/csm-data/api_env_variables.bash | Switches env var example from scenario ID to runner ID |
| tutorial/cosmotech-api/workspace_operations.py | Migrates workspace tutorial to WorkspaceApi wrapper |
| tutorial/cosmotech-api/twin_data_layer.py | Updates TDL tutorial to use raw SDK TwinGraphApi via Connection |
| tutorial/cosmotech-api/runner_operations.py | Migrates runner tutorial to RunnerApi + Configuration |
| tutorial/cosmotech-api/connection_setup.py | Migrates connection tutorial to Connection object |
| tutorial/cosmotech-api/complete_workflow.py | Refactors complete workflow tutorial to new wrappers/configuration approach |
| docs/tutorials/datastore.md | Adds Parquet to datastore docs + includes new tutorial script |
| docs/tutorials/csm-data.md | Updates csm-data store capability list (incl. Parquet/output/delete) |
| docs/tutorials/cosmotech-api.md | Reworks CosmoTech API tutorial docs to new wrappers and dataset section |
| docs/csm-data/store/output.md | New command-help include page for csm-data store output |
| docs/csm-data/store/load-parquet-folder.md | New command-help include page for csm-data store load-parquet-folder |
Suppressed comments (2)
tutorial/cosmotech-api/complete_workflow.py:94
DatasetApi.upload_dataset()is being called with keyword arguments (organization_id,dataset_id,file_path) that do not match CoAL’sDatasetApi.upload_dataset(dataset_name, as_files, ...)signature. This will raise aTypeErrorat runtime and won’t update the existing dataset.
dataset_api = DatasetApi(config)
dataset_api.upload_dataset(
organization_id=organization_id,
dataset_id=output_dataset_id,
file_path=str(processed_file),
)
tutorial/cosmotech-api/complete_workflow.py:67
- If
customers.csvexists but is empty (or only has headers),customerswill be empty andcustomers[0]will raiseIndexError(and later divisions bylen(customers)will fail). Add a guard before usingcustomers[0].
processed_file = processed_dir / "customers_with_loyalty.csv"
with open(processed_file, "w", newline="") as f:
writer = csv.DictWriter(f, fieldnames=list(customers[0].keys()))
writer.writeheader()
writer.writerows(customers)
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+148
to
+152
| dataset_api.upload_dataset_parts( | ||
| organization_id=organization_id, | ||
| workspace_id=workspace_id, | ||
| twin_graph_id=twin_graph_id, | ||
| twin_graph_cypher_query={ | ||
| "query": query, | ||
| "parameters": params | ||
| } | ||
| dataset_id=dataset_id, | ||
| folder_path="/tmp/data/parts/", | ||
| ) |
Comment on lines
8
to
10
| from cosmotech.coal.utils.configuration import Configuration | ||
| from cosmotech.coal.utils.logger import LOGGER | ||
|
|
Comment on lines
6
to
8
| from cosmotech.coal.utils.configuration import Configuration | ||
| from cosmotech.coal.utils.logger import LOGGER | ||
|
|
Comment on lines
5
to
7
| from cosmotech.coal.cosmotech_api.apis import WorkspaceApi | ||
| from cosmotech.coal.utils.logger import LOGGER | ||
|
|
- restablish ws_api calls details - update dataset_api calls - add new line (x2) to fix lists rendering - remove unused logger imports - remove deprecated TDL script - rename upload_workspace_file call args
HectorJM2018Cosmo
force-pushed
the
HJM/doc_1.x_to_2.x
branch
from
August 13, 2026 14:14
e1fd8f4 to
953cac5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cf. https://cosmo-tech.atlassian.net/browse/PROD-16391