Skip to content

Commit 0749f98

Browse files
committed
chore: separate and update translation files and keys for csm-data
1 parent 4d3876b commit 0749f98

38 files changed

+386
-436
lines changed

cosmotech/csm_data/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def print_version(ctx, param, value):
3636
callback=print_version,
3737
expose_value=False,
3838
is_eager=True,
39-
help="Print version number and return.",
39+
help=T("csm_data.commands.main.parameters.version"),
4040
)
4141
@web_help("csm-data")
4242
@translate_help("csm_data.commands.main.description")

cosmotech/csm_data/utils/decorators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def wrap_function(func):
5959
@click.option(
6060
"--web-help",
6161
is_flag=True,
62-
help="Open the web documentation",
62+
help=T("csm_data.commons.decorators.parameters.web_help").format(url=documentation_url),
6363
is_eager=True,
6464
callback=open_documentation,
6565
)

cosmotech/translation/csm_data/en-US/csm_data.yml

Lines changed: 0 additions & 434 deletions
This file was deleted.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
description: |
2+
Cosmo Tech API helper command
3+
4+
This command will inform you of which connection is available to use for the Cosmo Tech API
5+
6+
If no connection is available, will list all possible set of parameters and return an error code,
7+
8+
You can use this command in a csm-orc template to make sure that API connection is available.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
description: |
2+
Send runner metadata to a PostgreSQL database.
3+
4+
Creates or updates a table in PostgreSQL with runner metadata including id, name, last run id, and run template id.
5+
The table will be created if it doesn't exist, and existing records will be updated based on the runner id.
6+
parameters:
7+
organization_id: An organization id for the Cosmo Tech API
8+
workspace_id: A workspace id for the Cosmo Tech API
9+
runner_id: A runner id for the Cosmo Tech API
10+
table_prefix: Prefix to add to the table name
11+
postgres_host: PostgreSQL host URI
12+
postgres_port: PostgreSQL database port
13+
postgres_db: PostgreSQL database name
14+
postgres_schema: PostgreSQL schema name
15+
postgres_user: PostgreSQL connection user name
16+
postgres_password: PostgreSQL connection password
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
description: |
2+
Load data from a runner's RDS database into a CSV file.
3+
4+
Executes a SQL query against the runner's RDS database and saves the results to a CSV file.
5+
By default, it will list all tables in the public schema if no specific query is provided.
6+
parameters:
7+
target_folder: The folder where the csv will be written
8+
organization_id: An organization id for the Cosmo Tech API
9+
workspace_id: A workspace id for the Cosmo Tech API
10+
runner_id: A runner id for the Cosmo Tech API
11+
run_id: A run id for the Cosmo Tech API
12+
file_name: A file name to write the query results
13+
query: SQL query to execute (defaults to listing all tables in public schema)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
description: |
2+
Send CSV files to a runner's RDS database.
3+
4+
Takes all CSV files from a source folder and sends their content to the runner's RDS database.
5+
Each CSV file will be sent to a table named after the file (without the .csv extension).
6+
The table name will be prefixed with "CD_" in the database.
7+
parameters:
8+
source_folder: The folder containing csvs to send
9+
organization_id: An organization id for the Cosmo Tech API
10+
workspace_id: A workspace id for the Cosmo Tech API
11+
runner_id: A runner id for the Cosmo Tech API
12+
run_id: A run id for the Cosmo Tech API
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
description: |
2+
Send data from a store to a runner's RDS database.
3+
4+
Takes all tables from a store and sends their content to the runner's RDS database.
5+
Each table will be sent to a table with the same name, prefixed with "CD_" in the database.
6+
Null values in rows will be removed before sending.
7+
parameters:
8+
store_folder: The folder containing the store files
9+
organization_id: An organization id for the Cosmo Tech API
10+
workspace_id: A workspace id for the Cosmo Tech API
11+
runner_id: A runner id for the Cosmo Tech API
12+
run_id: A run id for the Cosmo Tech API
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
description: |
2+
Download a runner data from the Cosmo Tech API
3+
Requires a valid Azure connection either with:
4+
- The AZ cli command: az login
5+
- A triplet of env var AZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRET
6+
parameters:
7+
organization_id: The id of an organization in the cosmotech api
8+
workspace_id: The id of a workspace in the cosmotech api
9+
runner_id: The id of a runner in the cosmotech api
10+
parameters_absolute_path: A local folder to store the parameters content
11+
dataset_absolute_path: A local folder to store the main dataset content
12+
write_json: Whether to write the data in JSON format
13+
write_csv: Whether to write the data in CSV format
14+
fetch_dataset: Whether to fetch datasets
15+
parallel: Whether to fetch datasets in parallel
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
description: |
2+
Uses environment variables to download cloud based Template steps
3+
parameters:
4+
organization_id: The id of an organization in the cosmotech api
5+
workspace_id: The id of a solution in the cosmotech api
6+
run_template_id: The name of the run template in the cosmotech api
7+
handler_list: A list of handlers to download (comma separated)

0 commit comments

Comments
 (0)