### Install Project with Make Source: https://github.com/preset-io/superset-sup/blob/main/CLAUDE.md Installs the project using the Makefile, which internally utilizes uv for package installation. ```bash # Or using make (which uses uv) make install ``` -------------------------------- ### Install and Configure Superset CLI Source: https://github.com/preset-io/superset-sup/blob/main/PROJECT.md Install the Superset CLI from the monorepo and perform a quick setup with Preset by listing workspaces, setting a default workspace, and setting a default database. ```bash # Install from the monorepo pip install -e . # Quick setup with Preset sup workspace list # Prompts for API credentials if needed sup workspace use # Set default workspace sup database use # Set default database # Now everything just works! sup sql "SELECT 1" # Uses configured context sup dashboard list --mine # Your dashboards ``` -------------------------------- ### Install superset-sup CLI Source: https://github.com/preset-io/superset-sup/blob/main/README.md Install the 'sup! CLI using pip. You can install from PyPI or directly from the GitHub repository. ```bash pip install superset-sup ``` ```bash pip install git+https://github.com/preset-io/superset-sup.git ``` -------------------------------- ### Full Migration Example: Export, Import, and Verify Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/guides/multi-asset.md A comprehensive example demonstrating a full migration process: exporting all assets from a source workspace, importing them into a target workspace, and verifying the migration. ```bash # 1. Export from source sup workspace use source-workspace sup workspace export --all --output ./migration/ # 2. Review exported assets ls -la ./migration/assets/ # 3. Import to target sup workspace use target-workspace sup workspace import ./migration/ --force # 4. Verify migration sup dashboard list --limit 10 sup chart list --limit 10 ``` -------------------------------- ### Install Superset Sup CLI from Source Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/installation.md Clone the repository and install the Superset Sup CLI from its source code. ```bash git clone https://github.com/preset-io/superset-sup.git cd superset-sup pip install -e . ``` -------------------------------- ### Basic 'sup sync' Command Execution Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/commands/sync.mdx This is a minimal example of how to execute the 'sup sync' command. ```bash sup sync ``` -------------------------------- ### Sync Configuration: All Assets Selection Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/config/sync.md Example of selecting all assets of a specific type. Ensure `include_dependencies` is set as needed. ```yaml charts: selection: all include_dependencies: true ``` -------------------------------- ### Test Installation from PyPI Source: https://github.com/preset-io/superset-sup/blob/main/PUBLISHING.md Install the 'superset-sup' package from PyPI using pip and verify that the installed commands are available. ```bash # Install from PyPI pip install superset-sup # Verify all three commands are available sup --help preset-cli --help superset-cli --help ``` -------------------------------- ### Install Superset Sup CLI using uv Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/installation.md Install the Superset Sup CLI package using uv for potentially faster installation. ```bash uv pip install superset-sup ``` -------------------------------- ### Install Project with uv Source: https://github.com/preset-io/superset-sup/blob/main/CLAUDE.md Installs the project in editable mode with testing dependencies using uv, the preferred package installer for speed. ```bash # Using uv (preferred for fastest installation) uv pip install -e '.[testing]' ``` -------------------------------- ### Basic Usage of sup query Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/commands/query.mdx Run this command to perform basic query operations. No specific setup is required beyond having the 'sup' CLI installed. ```bash sup query ``` -------------------------------- ### Quick Example: Workspace, Chart Pull, SQL, and Chart Push Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/index.mdx Demonstrates setting a workspace, pulling charts, running SQL queries, and pushing charts to another workspace. ```bash # Set your workspace sup workspace use 123 # Pull your charts sup chart pull --mine # Run SQL queries sup sql "SELECT COUNT(*) FROM users" # Push to another workspace sup chart push --workspace-id 456 ``` -------------------------------- ### Install Build Tools Source: https://github.com/preset-io/superset-sup/blob/main/PUBLISHING.md Install the necessary tools for building and uploading Python packages to PyPI. This includes the 'build' and 'twine' packages. ```bash pip install build twine ``` -------------------------------- ### Test Installation from TestPyPI Source: https://github.com/preset-io/superset-sup/blob/main/PUBLISHING.md Install the package from TestPyPI, specifying the index URL. This is crucial for testing beta releases before they go to production PyPI. ```bash pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ superset-sup ``` -------------------------------- ### Migrating from Legacy preset-cli to Superset CLI Source: https://github.com/preset-io/superset-sup/blob/main/README.md Example commands demonstrating the migration path from the legacy 'preset-cli' to the modern 'sup' CLI for common tasks. ```bash # Legacy preset-cli preset-cli --workspaces=https://workspace.preset.io/ superset export # Modern sup sup workspace use 123 sup chart pull --mine ``` -------------------------------- ### Verify Superset Sup CLI Installation Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/installation.md Check the installed version of the Superset Sup CLI to verify the installation. ```bash sup --version ``` -------------------------------- ### Example CLI Command Structure Source: https://github.com/preset-io/superset-sup/blob/main/CLAUDE.md Illustrates the general structure of a Superset CLI command, including authentication and workspace selection. ```bash preset-cli --workspaces=https://workspace.preset.io/ superset [command] [options] ``` -------------------------------- ### Sync Configuration Schema Example Source: https://github.com/preset-io/superset-sup/blob/main/CLAUDE.md An example YAML configuration file for defining multi-target sync operations, including source and target workspace details, and asset selection. Note the absence of an 'overwrite' option in sync operations. ```yaml source: workspace_id: 187 assets: dashboards: selection: ids ids: [254] include_dependencies: true charts: selection: all include_dependencies: true # NOTE: No overwrite option - always true in sync operations target_defaults: overwrite: false # For push operations jinja_context: company: Default Company region: us-east-1 targets: - workspace_id: 456 name: production jinja_context: environment: production ``` -------------------------------- ### Install Superset Sup CLI using pip Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/installation.md Install the Superset Sup CLI package from the Python Package Index (PyPI). ```bash pip install superset-sup ``` -------------------------------- ### Configuration File Example Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/config/settings.md Defines the structure of the sup CLI configuration file located at `~/.config/sup/config.yaml`. Use this to set persistent preferences. ```yaml source_workspace_id: 123 target_workspace_id: 456 output_format: table theme: emerald ``` -------------------------------- ### Sync Configuration: My Assets Only Selection Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/config/sync.md Example for selecting only assets that the current user owns. Useful for personal synchronization tasks. ```yaml datasets: selection: mine include_dependencies: false ``` -------------------------------- ### Starlight Theme Configuration Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/README.md Example of configuring the starlight-theme-rapide with custom emerald green accent colors. ```javascript starlightThemeRapide({ starlightConfig: { accent: { 200: '#a7f3d0', 600: '#10b981', 900: '#047857', 950: '#022c22' } } }) ``` -------------------------------- ### Sync Configuration: By IDs Selection Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/config/sync.md Example of selecting specific assets by their IDs. Useful for targeted synchronization of particular dashboards or charts. ```yaml dashboards: selection: ids ids: [254, 255, 256] include_dependencies: true ``` -------------------------------- ### Common npm Commands Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/README.md Essential npm commands for managing the sup CLI documentation site, including installation, development server, and building. ```bash npm install # Installs dependencies npm run dev # Starts local dev server at `localhost:4321` npm run build # Build production site to `./dist/` npm run preview # Preview build locally before deploying ``` -------------------------------- ### Execute SQL Query (Porcelain Output) Source: https://github.com/preset-io/superset-sup/blob/main/README.md Run a SQL query and get the results in a machine-readable format with no decorations. ```bash sup sql "query" --porcelain ``` -------------------------------- ### dbt Integration Configuration Keys Source: https://github.com/preset-io/superset-sup/blob/main/CLAUDE.md Required configuration keys for integrating dbt with Superset, differentiating between dbt Core and dbt Cloud setups. ```bash # dbt Core dbt-profiles-dir, dbt-project-dir # dbt Cloud dbt-cloud-account-id, dbt-cloud-project-id, dbt-cloud-job-id, dbt-cloud-api-token ``` -------------------------------- ### Basic 'sup user' Command Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/commands/user.mdx Executes the base 'sup user' command, typically showing help or default actions. This is a starting point for exploring user management options. ```bash sup user ``` -------------------------------- ### setup_logging Function Source: https://github.com/preset-io/superset-sup/blob/main/docs/api/preset_cli.md Sets up basic logging configuration for the CLI. ```APIDOC ## preset_cli.lib.setup_logging(loglevel: str) → None ### Description Setup basic logging. ### Parameters * **loglevel** (str) - Required - The desired logging level (e.g., 'INFO', 'DEBUG'). ``` -------------------------------- ### Set Up Authentication Credentials Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/commands/config.mdx Use this command to configure the authentication credentials for Superset Sup. ```bash sup config auth ``` -------------------------------- ### Activate Virtual Environment Source: https://github.com/preset-io/superset-sup/blob/main/CLAUDE.md Activates the Python virtual environment before proceeding with package installations or other development tasks. ```bash # Activate virtual environment first source .venv/bin/activate ``` -------------------------------- ### Initialize Sup Configuration Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/commands/config.mdx Initializes the Superset Sup configuration in the current directory. ```bash sup config init ``` -------------------------------- ### Get Chart Compiled SQL Source: https://github.com/preset-io/superset-sup/blob/main/README.md Retrieve the compiled SQL query that is used to generate the data for a specific chart. ```bash sup chart sql 3628 ``` -------------------------------- ### Initialize SupersetClient for SQL Queries Source: https://github.com/preset-io/superset-sup/blob/main/docs/api/preset_cli.api.clients.md Demonstrates how to initialize the SupersetClient with a URL and authentication credentials. The client is used to run SQL queries against Superset, returning results as a Pandas DataFrame. ```python from yarl import URL from preset_cli.api.clients.superset import SupersetClient from preset_cli.auth.superset import UsernamePasswordAuth url = URL("http://localhost:8088/") auth = UsernamePasswordAuth(url, "admin", "admin") client = SupersetClient(url, auth) sql = "SELECT platform, rank FROM video_game_sales LIMIT 2" print(client.run_query(database_id=1, sql=sql)) ``` -------------------------------- ### Show Available Environment Variables Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/commands/config.mdx Displays all available environment variables that can be used for Superset Sup configuration. ```bash sup config env ``` -------------------------------- ### Basic Sup Theme Command Execution Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/commands/theme.mdx This demonstrates the most basic way to execute the Superset theme command, typically to view default settings or initiate a general theme check. ```bash sup theme ``` -------------------------------- ### Preview Multi-Asset Sync Changes Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/guides/multi-asset.md Execute a dry run of the sync operation using the defined configuration file to preview all intended changes without applying them. ```bash sup sync run multi-asset-sync.yml --dry-run ``` -------------------------------- ### Execute SQL Query (JSON Output) Source: https://github.com/preset-io/superset-sup/blob/main/README.md Run a SQL query and get the results in JSON format, suitable for automation and agents. ```bash sup sql "SELECT * FROM sales" --json ``` -------------------------------- ### Clean Virtual Environment Source: https://github.com/preset-io/superset-sup/blob/main/CLAUDE.md Removes the project's virtual environment directory to perform a clean slate setup or free up disk space. ```bash # Remove virtual environment make clean ``` -------------------------------- ### Check Built Packages Source: https://github.com/preset-io/superset-sup/blob/main/PUBLISHING.md List the contents of the 'dist/' directory to verify that both source distribution (.tar.gz) and wheel (.whl) files have been created. ```bash ls -lh dist/ ``` -------------------------------- ### Manage Users and Security Source: https://github.com/preset-io/superset-sup/blob/main/PROJECT.md List all users, export security configurations (users, roles, ownership) to YAML, and import security configurations. ```bash sup user list # All users sup user export --folder=./security/ # Export users, roles, ownership sup user import ./security/ --overwrite # Import security config ``` -------------------------------- ### Legacy CLI Structure Source: https://github.com/preset-io/superset-sup/blob/main/CLAUDE.md Overview of the directory structure for the legacy Preset CLI. ```tree src/preset_cli/ ├── api/clients/ # API client implementations │ ├── preset.py # Preset API client │ └── superset.py # Superset API client ├── auth/ # Authentication modules │ ├── preset.py # Preset-specific auth │ ├── superset.py # Superset auth │ ├── jwt.py # JWT token handling │ └── token.py # Token management ├── cli/ # CLI command implementations │ ├── main.py # Main preset-cli entry point │ ├── superset/ # Superset-specific commands │ │ ├── main.py # superset-cli entry point │ │ ├── export.py # Export resources │ │ ├── sql.py # SQL execution │ │ └── sync/ # Synchronization commands │ │ ├── native/ # Native YAML sync │ │ └── dbt/ # dbt project sync │ └── export_users.py # User export functionality └── lib.py # Shared utilities ``` -------------------------------- ### Get Compiled SQL for a Chart Source: https://github.com/preset-io/superset-sup/blob/main/README.md Retrieve the exact SQL query used by a chart, including filters and aggregations. This is useful for understanding the business logic and how Superset executes queries. ```bash sup chart sql 3628 # Output: Complex SQL with filters, aggregations, joins - the actual query # Superset runs ``` -------------------------------- ### Configure dbt Cloud Integration Source: https://github.com/preset-io/superset-sup/blob/main/PROJECT.md Set up Superset CLI to integrate with dbt Cloud by configuring account ID, project ID, job ID, and API token. ```bash sup config set dbt-cloud-account-id 12345 # dbt Cloud account sup config set dbt-cloud-project-id 67890 # dbt Cloud project sup config set dbt-cloud-job-id 11111 # Specific job for sync sup config set dbt-cloud-api-token xyz123 # dbt Cloud API access ``` -------------------------------- ### Get Compiled SQL for a Chart Source: https://github.com/preset-io/superset-sup/blob/main/PROJECT.md Retrieve the compiled SQL query for a specific Superset chart using its ID. This is useful for understanding the underlying logic and filters applied to a chart. ```bash # Get the compiled SQL behind any chart sup chart sql 3628 ``` ```sql SELECT DATE_TRUNC(`ds`, DAY) AS `ds`, sum(`PLG`) AS `PLG`, sum(`conversions`) AS `conversions` FROM ( SELECT DATE_TRUNC(`ds`, DAY) AS `ds`, SUM(CASE WHEN nrr_attribution = 'SELF_SERVE' THEN recurly_arr ELSE 0 END) AS PLG, SUM(WHEN nrr_attribution = 'SALES_LED' THEN sales_led_arr ELSE 0 END) AS sales_led FROM `core_history`.`manager_team_history` WHERE (arr > 0) GROUP BY 1 ORDER BY 1 ) AS `virtual_table` WHERE `ds` >= CAST('2023-02-01' AS DATE) AND EXTRACT(MONTH FROM ds) IN (2,5,8,11) GROUP BY `ds` ORDER BY `PLG` DESC LIMIT 1000 ``` -------------------------------- ### Project Structure Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/README.md Overview of the directory structure for the sup CLI documentation site. ```bash docs-site/ ├── src/ │ ├── content/ │ │ └── docs/ │ │ ├── commands/ # Auto-generated CLI command docs │ │ ├── config/ # Configuration guides │ │ ├── guides/ # User guides and tutorials │ │ ├── index.mdx # Homepage │ │ ├── introduction.md # Getting started │ │ ├── installation.md # Installation guide │ │ └── quick-start.md # Quick start guide │ └── content.config.ts ├── astro.config.mjs # Starlight + theme configuration └── package.json ``` -------------------------------- ### Multi-Asset Sync Workflow Creation and Execution Source: https://github.com/preset-io/superset-sup/blob/main/CLAUDE.md Commands to create, run, and validate multi-asset sync configurations. Use --dry-run to preview operations or --pull-only to only pull from the source. ```bash sup sync create ./my_sync --source 123 --targets 456,789 sup sync run ./my_sync --dry-run sup sync run ./my_sync --pull-only sup sync validate ./my_sync ``` -------------------------------- ### Display Current Configuration Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/commands/config.mdx Use this command to view the current configuration settings of Superset Sup. ```bash sup config show ``` -------------------------------- ### Run Sync with Configuration File Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/guides/cross-workspace.md Execute a cross-workspace synchronization process using a defined YAML configuration file. ```bash sup sync run ./sync_config.yml ``` -------------------------------- ### Basic 'sup database' Command Usage Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/commands/database.mdx This snippet shows the most basic way to invoke the 'sup database' command to view available subcommands or general database management options. ```bash sup database ``` -------------------------------- ### Manage Databases Source: https://github.com/preset-io/superset-sup/blob/main/PROJECT.md List databases within the current workspace and set the default database. ```bash sup database list # Databases in current workspace sup database use 5 # Set default database ``` -------------------------------- ### Build Distribution Packages Source: https://github.com/preset-io/superset-sup/blob/main/PUBLISHING.md Use the 'build' module to create distribution packages (source distribution and wheel) for the project. ```bash python -m build ``` -------------------------------- ### Login and Logout with sup CLI Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/config/authentication.md Manage your authentication credentials by logging in to store them or logging out to clear them. This simplifies repeated authentication. ```bash # Store credentials sup auth login # Clear stored credentials sup auth logout ``` -------------------------------- ### Configuration Management Source: https://github.com/preset-io/superset-sup/blob/main/CLAUDE.md Commands to display current Superset CLI settings and set configuration values, such as the target workspace ID. ```bash sup config show sup config set target-workspace-id 789 ``` -------------------------------- ### Execute Multi-Asset Sync Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/guides/multi-asset.md Run the sync operation using the defined configuration file to apply changes to the target workspace. ```bash sup sync run multi-asset-sync.yml ``` -------------------------------- ### Configure Superset CLI Authentication Source: https://github.com/preset-io/superset-sup/blob/main/README.md Set up authentication for the Superset CLI. The recommended method is using API tokens, which can be configured interactively via 'sup config auth' or by setting environment variables SUP_PRESET_API_TOKEN and SUP_PRESET_API_SECRET. ```bash sup config auth # Interactive setup # Or set environment variables: export SUP_PRESET_API_TOKEN="your-token" export SUP_PRESET_API_SECRET="your-secret" ``` -------------------------------- ### Sup Theme Command Usage Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/commands/theme.mdx This is the basic command structure for interacting with Superset theme functionalities. Use this to see available subcommands and options. ```bash sup theme [COMMAND] [OPTIONS] ``` -------------------------------- ### Multi-Target Synchronization with Templating Source: https://github.com/preset-io/superset-sup/blob/main/README.md Create and run sync jobs for multi-target synchronization, supporting Jinja2 templating for environment-specific configurations. Use --option to pass template variables. ```bash # Multi-target synchronization with templating sup sync create ./templates --source 123 --targets 456,789,101 sup sync run ./templates --option env=prod # Jinja2 templating for # environments ``` -------------------------------- ### Superset CLI Sync Command Usage Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/commands/sync.mdx This shows the basic structure for using the 'sup sync' command and its subcommands. ```bash sup sync [COMMAND] [OPTIONS] ``` -------------------------------- ### List Superset Workspaces Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/commands/workspace.mdx Use this command to view all available workspaces in your Superset environment. ```bash sup workspace list ``` -------------------------------- ### Modern sup CLI Structure Source: https://github.com/preset-io/superset-sup/blob/main/CLAUDE.md Overview of the directory structure for the modern 'sup' CLI. ```tree src/sup/ ├── main.py # Main sup entry point with beautiful branding ├── commands/ # Entity-focused command modules │ ├── workspace.py # Workspace management + cross-workspace config │ ├── database.py # Database operations │ ├── dataset.py # Dataset management │ ├── chart.py # Chart pull/push with dependency management │ ├── dashboard.py # Dashboard operations │ ├── query.py # Saved query discovery │ ├── user.py # User management │ ├── sql.py # Direct SQL execution │ ├── sync.py # Multi-asset sync operations (NEW) │ └── config.py # Configuration management ├── clients/ # sup-specific client wrappers │ ├── preset.py # Wrapped PresetClient with sup UX │ └── superset.py # Wrapped SupersetClient with sup UX ├── config/ # Modern Pydantic configuration │ ├── settings.py # Type-safe config models │ ├── sync.py # Sync configuration models (NEW) │ └── paths.py # Config file path resolution ├── filters/ # Universal filtering system │ ├── base.py # UniversalFilters for all entities │ └── chart.py # Chart-specific filters ├── output/ # Beautiful Rich output system │ ├── styles.py # Emerald green Preset branding │ ├── formatters.py # Output format handlers │ ├── tables.py # Rich table formatting │ └── spinners.py # Loading indicators └── auth/ └── preset.py # sup-compatible auth ``` -------------------------------- ### Basic 'sup config' Command Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/commands/config.mdx This is the most basic usage of the 'sup config' command, typically used to display default or current settings. ```bash sup config ``` -------------------------------- ### Sup Workspace CLI Usage Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/commands/workspace.mdx The base command for interacting with Superset workspaces. ```bash sup workspace [COMMAND] [OPTIONS] ``` -------------------------------- ### Create Sync Configuration Source: https://github.com/preset-io/superset-sup/blob/main/README.md Define a new synchronization configuration for assets between workspaces. Supports Jinja2 templating. ```bash sup sync create ./my_sync --source 123 --targets 456,789 ``` -------------------------------- ### Configure dbt Cloud Credentials Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/guides/dbt-integration.md Set up your dbt Cloud account, project, job IDs, and API token. These credentials are required for the CLI to authenticate with dbt Cloud. ```bash sup config set dbt-cloud-account-id 12345 sup config set dbt-cloud-project-id 67890 sup config set dbt-cloud-job-id 11111 sup config set dbt-cloud-api-token "your-token" ``` -------------------------------- ### Invite Users to Teams Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/commands/user.mdx Sends invitations to users to join Preset teams. This is the primary method for onboarding new team members. ```bash sup user invite ``` -------------------------------- ### List Datasets with Search Source: https://github.com/preset-io/superset-sup/blob/main/README.md Retrieve a list of datasets, filtering by name using server-side search. ```bash sup dataset list --search="users" ``` -------------------------------- ### SupersetClient Methods Source: https://github.com/preset-io/superset-sup/blob/main/docs/api/preset_cli.api.md This section lists the available methods for interacting with Superset via the Preset CLI client. These methods allow for retrieving various Superset resources, managing data, and configuring roles and permissions. ```APIDOC ## SupersetClient Methods This section details the methods available on the `SupersetClient` for interacting with Superset. ### `get_chart(chart_id)` Retrieves a specific chart by its ID. ### `get_charts()` Retrieves a list of all charts. ### `get_dashboard(dashboard_id)` Retrieves a specific dashboard by its ID. ### `get_dashboards()` Retrieves a list of all dashboards. ### `get_data(query)` Executes a query to retrieve data. ### `get_database(database_id)` Retrieves a specific database configuration by its ID. ### `get_databases()` Retrieves a list of all database configurations. ### `get_dataset(dataset_id)` Retrieves a specific dataset by its ID. ### `get_datasets()` Retrieves a list of all datasets. ### `get_refreshed_dataset_columns(dataset_id)` Retrieves the refreshed column information for a specific dataset. ### `get_resource(resource_type, resource_id)` Retrieves a generic resource by its type and ID. ### `get_resource_endpoint_info(resource_type)` Retrieves information about the endpoint for a given resource type. ### `get_resources(resource_type)` Retrieves a list of resources of a specified type. ### `get_rls(dataset_id)` Retrieves Row-Level Security (RLS) policies for a specific dataset. ### `get_role_id(role_name)` Retrieves the ID of a role by its name. ### `get_role_permissions(role_id)` Retrieves the permissions associated with a specific role ID. ### `get_uuids(resource_type, names)` Retrieves the UUIDs for a list of resource names of a specified type. ### `import_ownership(data)` Imports ownership information. ### `import_rls(data)` Imports Row-Level Security (RLS) policies. ### `import_role(data)` Imports role definitions. ### `import_zip(file_path)` Imports resources from a zip file. ### `run_query(query_object)` Executes a query object. ### `update_dashboard(dashboard_id, data)` Updates a specific dashboard. ### `update_database(database_id, data)` Updates a specific database configuration. ### `update_dataset(dataset_id, data)` Updates a specific dataset. ### `update_resource(resource_type, resource_id, data)` Updates a generic resource. ### `update_role(role_id, data)` Updates a specific role. ### `validate_key_in_resource_schema(resource_type, key, value)` Validates a key-value pair against the schema of a resource type. ``` -------------------------------- ### preset_cli.cli.superset.sync.dbt.lib.create_engine_with_check Source: https://github.com/preset-io/superset-sup/blob/main/docs/api/preset_cli.cli.superset.sync.dbt.md Creates a SQLAlchemy engine and checks for required dependencies. ```APIDOC ## preset_cli.cli.superset.sync.dbt.lib.create_engine_with_check ### Description Returns a SQLAlchemy engine or raises an error if missing required dependency. ### Parameters * **url** (URL) - Required - The SQLAlchemy URI. ### Returns * **Engine** - The SQLAlchemy engine. ``` -------------------------------- ### Reset Configuration to Defaults Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/config/settings.md Use the `sup config reset` command to revert all configuration settings to their default values. ```bash sup config reset ``` -------------------------------- ### Jinja Templating in SQL Queries Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/config/sync.md Demonstrates using Jinja templating for dynamic SQL queries, allowing variables like environment and company to be injected. ```sql -- In your SQL query SELECT * FROM {{ environment }}_sales_data WHERE company = '{{ company }}' ``` -------------------------------- ### Environment Variables for Authentication and Output Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/config/settings.md Set environment variables to configure authentication tokens and output preferences for the sup CLI. These override file settings. ```bash # Authentication export PRESET_API_TOKEN="your-token" export PRESET_API_SECRET="your-secret" # Output preferences export SUP_OUTPUT_FORMAT="json" export SUP_THEME="emerald" ``` -------------------------------- ### SupersetClient Methods Source: https://github.com/preset-io/superset-sup/blob/main/docs/api/preset_cli.api.clients.md This section details the various methods available on the SupersetClient for interacting with Superset resources. These methods cover creating, retrieving, exporting, and managing resources like dashboards, datasets, databases, users, roles, and RLS rules. ```APIDOC ## SupersetClient Class Bases: `object` A client for running queries against Superset. ### Methods #### create_dashboard(**kwargs: Any) -> Any Create a dashboard. #### create_database(**kwargs: Any) -> Any Create a database. #### create_dataset(**kwargs: Any) -> Any Create a dataset. #### create_resource(resource_name: str, **kwargs: Any) -> Any Create a resource. #### export_ownership(resource_name: str) -> Iterator[OwnershipType] Return information about resource ownership. #### export_rls() -> Iterator[RuleType] Return all RLS rules. #### export_rls_legacy() -> Iterator[RuleType] Return all RLS rules from legacy endpoint. #### export_roles() -> Iterator[RoleType] Return all roles. #### export_users() -> Iterator[UserType] Return all users. #### export_zip(resource_name: str, ids: List[int]) -> BytesIO Export one or more of a resource. #### get_chart(chart_id: int) -> Any Return a single chart. #### get_charts(**kwargs: str) -> List[Any] Return charts, possibly filtered. #### get_dashboard(dashboard_id: int) -> Any Return a single dashboard. #### get_dashboards(**kwargs: str) -> List[Any] Return dashboards, possibly filtered. #### get_data(dataset_id: int, metrics: List[str], columns: List[str], order_by: List[str] | None = None, order_desc: bool = True, is_timeseries: bool = False, time_column: str | None = None, start: datetime | None = None, end: datetime | None = None, granularity: str | None = None, where: str = '', having: str = '', row_limit: int = 10000, force: bool = False) -> DataFrame Run a dimensional query. #### get_database(database_id: int) -> Any Return a single database. #### get_databases(**kwargs: str) -> List[Any] Return databases, possibly filtered. #### get_dataset(dataset_id: int) -> Any Return a single dataset. #### get_datasets(**kwargs: str) -> List[Any] Return datasets, possibly filtered. #### get_refreshed_dataset_columns(dataset_id: int) -> List[Any] Return dataset columns. #### get_resource(resource_name: str, resource_id: int) -> Any Return a single resource. #### get_resource_endpoint_info(resource_name: str, **kwargs: Any) -> Any Get resource endpoint info (such as available columns) possibly filtered. #### get_resources(resource_name: str, **kwargs: Any) -> List[Any] Return one or more of a resource, possibly filtered. #### get_rls(**kwargs: str) -> List[Any] Return RLS rules, possibly filtered. #### get_role_id(role_name: str) -> int Return the ID of a given role. #### get_role_permissions(role_id: int) -> List[int] Return the IDs of permissions associated with a role. #### get_uuids(resource_name: str) -> Dict[int, UUID] Get UUID of a list of resources. Still method is very inneficient, but it’s the only way to get the mapping between IDs and UUIDs in older versions of Superset. ``` -------------------------------- ### Configure dbt Core Project Paths Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/guides/dbt-integration.md Set the directory for your dbt project and profiles. Ensure these paths are correctly configured for the CLI to locate your dbt resources. ```bash sup config set dbt-project-dir /path/to/dbt/project sup config set dbt-profiles-dir ~/.dbt ``` -------------------------------- ### Manage Workspaces Source: https://github.com/preset-io/superset-sup/blob/main/PROJECT.md List available workspaces and set the default workspace for subsequent commands. ```bash sup workspace list # All workspaces sup workspace use 123 # Set default workspace ``` -------------------------------- ### preset_cli.cli.superset.sql.run_query Source: https://github.com/preset-io/superset-sup/blob/main/docs/api/preset_cli.cli.superset.md Executes a SQL query against a specified database. This function requires a Superset client instance, database ID, and the SQL query string. ```APIDOC ## preset_cli.cli.superset.sql.run_query(client: SupersetClient, database_id: int, schema: str | None, query: str) -> None ### Description Executes a SQL query in a given database using the provided Superset client. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **client** (SupersetClient) - An instance of the Superset client. * **database_id** (int) - The ID of the database to run the query against. * **schema** (str | None) - The schema to use for the query (optional). * **query** (str) - The SQL query to execute. ### Returns * **None** ``` -------------------------------- ### Sup Dashboard CLI Usage Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/commands/dashboard.mdx The base command for interacting with Superset dashboards. ```bash sup dashboard [COMMAND] [OPTIONS] ``` -------------------------------- ### Set Self-hosted Superset Credentials Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/config/authentication.md Authenticate with a self-hosted Superset instance using your Superset URL, username, and password. Ensure the URL is correct and credentials are valid. ```bash export SUPERSET_URL="https://your-superset.com" export SUPERSET_USERNAME="admin" export SUPERSET_PASSWORD="password" ``` -------------------------------- ### preset_cli.cli.superset.sql.run_session Source: https://github.com/preset-io/superset-sup/blob/main/docs/api/preset_cli.cli.superset.md Initiates an interactive SQL session for running multiple queries. This function requires client details, database information, and a URL for the session. ```APIDOC ## preset_cli.cli.superset.sql.run_session(client: SupersetClient, database_id: int, database_name: str, schema: str | None, url: URL) -> None ### Description Runs SQL queries in an interactive session with the Superset client. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **client** (SupersetClient) - An instance of the Superset client. * **database_id** (int) - The ID of the database for the session. * **database_name** (str) - The name of the database. * **schema** (str | None) - The schema to use for the session (optional). * **url** (URL) - The URL for the interactive session. ### Returns * **None** ``` -------------------------------- ### dbt Integration Configuration Source: https://github.com/preset-io/superset-sup/blob/main/PROJECT.md Configure the dbt integration by setting the dbt profiles directory and dbt project directory. This is essential for `sup database sync` and other dbt-related operations. ```bash # dbt Core integration sup config set dbt-profiles-dir ~/.dbt/ # dbt profiles location sup config set dbt-project-dir ./dbt-project/ # dbt project root ``` -------------------------------- ### Sync Configuration: Filter Selection Strategy Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/config/sync.md Placeholder for selecting assets based on filter criteria. The actual filter implementation is pending. ```yaml charts: selection: filter # Note: filter implementation pending ``` -------------------------------- ### PresetClient Methods Source: https://github.com/preset-io/superset-sup/blob/main/docs/api/preset_cli.api.md Enables management of users, teams, and workspaces within Preset, including role changes, invitations, and data exports/imports. ```APIDOC ## PresetClient Methods ### Description Methods for managing users, teams, and workspaces in Preset. ### Methods - `change_team_role(team_id: str, user_id: str, role: Role)` - `change_workspace_role(workspace_id: str, user_id: str, role: Role)` - `export_users(workspace_id: str)` - `get_base_url()` - `get_group_membership(group_id: str)` - `get_team_members(team_id: str)` - `get_teams()` - `get_workspaces()` - `import_users(workspace_id: str, users: list)` - `invite_users(workspace_id: str, users: list)` ``` -------------------------------- ### Push Roles and Permissions Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/commands/role.mdx Use this command to push roles and permissions from a YAML file into the Superset system, applying defined configurations. ```bash sup role push ``` -------------------------------- ### Backup Assets Workflow Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/quick-start.md A workflow to back up all charts and dashboards locally using Git. ```bash sup chart pull --all sup dashboard pull --all git add assets/ git commit -m "Backup analytics assets" ``` -------------------------------- ### Complete Sync Configuration File Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/config/sync.md Defines source workspace, target workspaces, and asset selection criteria for multi-workspace sync. Includes default target settings and specific target configurations with Jinja context. ```yaml source: workspace_id: 123 assets: dashboards: selection: ids ids: [254, 255] include_dependencies: true charts: selection: all include_dependencies: true datasets: selection: mine include_dependencies: false databases: selection: ids ids: [1, 2] include_dependencies: false target_defaults: overwrite: false include_dependencies: true jinja_context: environment: default company: ACME Corp region: us-east-1 targets: - workspace_id: 456 name: staging overwrite: true jinja_context: environment: staging database_host: staging-db.example.com - workspace_id: 789 name: production jinja_context: environment: production database_host: prod-db.example.com ``` -------------------------------- ### preset_cli.cli.superset.sync.dbt.datasets.sync_datasets Source: https://github.com/preset-io/superset-sup/blob/main/docs/api/preset_cli.cli.superset.sync.dbt.md Reads the dbt manifest and imports models as datasets, including associated metrics. ```APIDOC ## preset_cli.cli.superset.sync.dbt.datasets.sync_datasets ### Description Read the dbt manifest and import models as datasets with metrics. ### Parameters * **client** (SupersetClient) - Required - The Superset client instance. * **models** (List[ModelSchema]) - Required - A list of dbt models to sync. * **metrics** (Dict[str, List[SupersetMetricDefinition]]) - Required - A dictionary mapping model names to their Superset metric definitions. * **database** (Any) - Required - The database connection information. * **disallow_edits** (bool) - Required - If true, prevents edits to existing datasets. * **external_url_prefix** (str) - Required - The prefix for external URLs. * **certification** (Dict[str, Any] | None) - Optional - Certification information for datasets. * **reload_columns** (bool) - Optional - Defaults to True. Whether to reload columns for datasets. * **merge_metadata** (bool) - Optional - Defaults to False. Whether to merge metadata for datasets. ### Returns * **Tuple[List[Any], List[str]]** - A tuple containing a list of synced datasets and a list of sync errors. ``` -------------------------------- ### Synchronize Superset Objects Source: https://github.com/preset-io/superset-sup/blob/main/PROJECT.md Manage multi-target synchronization of Superset objects. Create sync configurations, preview operations, execute syncs, and validate configurations. ```bash sup sync create ./my_sync --source 123 --targets 456,789 # Create sync folder sup sync run ./my_sync --dry-run # Preview sync operations sup sync run ./my_sync # Execute full sync sup sync validate ./my_sync # Validate sync config ``` -------------------------------- ### Execute SQL Query (Rich Table Output) Source: https://github.com/preset-io/superset-sup/blob/main/README.md Run a SQL query against your Superset data source and display results in a rich, formatted table. ```bash sup sql "SELECT COUNT(*) FROM users" ``` -------------------------------- ### Upload to PyPI Source: https://github.com/preset-io/superset-sup/blob/main/PUBLISHING.md Upload the built distribution packages to PyPI. Use the 'twine upload' command, specifying the repository for production or TestPyPI. ```bash # For production PyPI twine upload dist/* # For TestPyPI (recommended for first-time testing) twine upload --repository testpypi dist/* ``` -------------------------------- ### Dataset Lifecycle Management (Stub) Source: https://github.com/preset-io/superset-sup/blob/main/CLAUDE.md Commands for listing, pulling, and pushing datasets. Pull/push functionality for datasets is currently a stub or not fully implemented. ```bash sup dataset list --search="sales" sup dataset pull --mine sup dataset push ``` -------------------------------- ### Running Superset Sync Commands Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/config/sync.md Provides bash commands for executing sync operations: dry run, pull only, push only, and a full sync. ```bash # Dry run to preview changes sup sync run ./sync_config.yml --dry-run # Pull from source sup sync run ./sync_config.yml --pull-only # Push to targets sup sync run ./sync_config.yml --push-only # Full sync (pull then push) sup sync run ./sync_config.yml ``` -------------------------------- ### SupersetClient Methods Source: https://github.com/preset-io/superset-sup/blob/main/docs/api/preset_cli.api.md This section outlines the methods available on the SupersetClient for managing Superset resources. These methods allow for the creation of dashboards, databases, and datasets, as well as the export of ownership, RLS policies (both legacy and current), roles, users, and a general zip export. ```APIDOC ## SupersetClient Methods This section outlines the methods available on the SupersetClient for managing Superset resources. These methods allow for the creation of dashboards, databases, and datasets, as well as the export of ownership, RLS policies (both legacy and current), roles, users, and a general zip export. ### `SupersetClient.create_dashboard()` Creates a new dashboard in Superset. ### `SupersetClient.create_database()` Creates a new database connection in Superset. ### `SupersetClient.create_dataset()` Creates a new dataset in Superset. ### `SupersetClient.create_resource()` Creates a generic resource in Superset. ### `SupersetClient.export_ownership()` Exports ownership information from Superset. ### `SupersetClient.export_rls()` Exports Row-Level Security (RLS) policies from Superset. ### `SupersetClient.export_rls_legacy()` Exports legacy Row-Level Security (RLS) policies from Superset. ### `SupersetClient.export_roles()` Exports role definitions from Superset. ### `SupersetClient.export_users()` Exports user information from Superset. ### `SupersetClient.export_zip()` Exports Superset resources as a zip archive. ``` -------------------------------- ### Set Configuration Value Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/commands/config.mdx Use this command to set a specific configuration value. ```bash sup config set workspace-id 123 ``` ```bash sup config set target-workspace-id 456 ``` ```bash sup config set assets-folder ./my-assets ``` -------------------------------- ### preset_cli.cli.main.get_teams Source: https://github.com/preset-io/superset-sup/blob/main/docs/api/preset_cli.cli.md Prompts the user to select teams from a list provided by the PresetClient. ```APIDOC ## preset_cli.cli.main.get_teams ### Description Prompt users for teams. ### Parameters * **client** – PresetClient instance ### Returns List of selected team names ``` -------------------------------- ### Generate CLI Documentation Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/README.md Command to automatically generate CLI documentation from the sup CLI using Python scripts. ```bash # From project root python scripts/generate_cli_docs.py ``` -------------------------------- ### preset_cli.cli.superset.sync.dbt.exposures.sync_exposures Source: https://github.com/preset-io/superset-sup/blob/main/docs/api/preset_cli.cli.superset.sync.dbt.md Writes Superset dashboards back to dbt as exposures. ```APIDOC ## preset_cli.cli.superset.sync.dbt.exposures.sync_exposures ### Description Write dashboards back to dbt as exposures. ### Parameters * **client** (SupersetClient) - Required - The Superset client instance. * **exposures_path** (Path) - Required - The path to the dbt exposures directory. * **datasets** (List[Any]) - Required - A list of Superset datasets. * **model_map** (Dict[ModelKey, ModelSchema]) - Required - A mapping from ModelKey to ModelSchema. ### Returns * **None** ``` -------------------------------- ### List All Users Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/commands/user.mdx Lists all users in the current or specified workspace. This is a fundamental command for user administration. ```bash sup user list ``` -------------------------------- ### preset_cli.cli.superset.sync.dbt.lib.build_postgres_sqlalchemy_params Source: https://github.com/preset-io/superset-sup/blob/main/docs/api/preset_cli.cli.superset.sync.dbt.md Builds SQLAlchemy connection parameters for a PostgreSQL target. ```APIDOC ## preset_cli.cli.superset.sync.dbt.lib.build_postgres_sqlalchemy_params ### Description Build the SQLAlchemy URI for a Postgres target. ### Parameters * **target** (Dict[str, Any]) - Required - The dbt target configuration. ### Returns * **Dict[str, Any]** - SQLAlchemy connection parameters for PostgreSQL. ``` -------------------------------- ### Analyze and Manage Charts Source: https://github.com/preset-io/superset-sup/blob/main/PROJECT.md List charts with search capabilities, retrieve the compiled SQL behind a chart, export chart data, and manage chart deployment (pull/push). ```bash sup chart list -l 5 --search="revenue" # Server-side multi-field search sup chart sql 3628 # Get SQL behind chart! sup chart data 3628 --csv # Export chart data! sup chart pull --mine # Pull your charts + dependencies sup chart push # Push charts to target workspace ``` -------------------------------- ### Set Source and Target Workspaces Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/guides/cross-workspace.md Configure the source and target workspaces for synchronization operations using the Superset CLI. ```bash # Set source workspace sup workspace use 123 # Set target workspace sup workspace set-target 456 ``` -------------------------------- ### Sup Config Command Usage Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/commands/config.mdx Basic command structure for the 'sup config' command. ```bash sup config [COMMAND] [OPTIONS] ``` -------------------------------- ### Publish to Production PyPI Source: https://github.com/preset-io/superset-sup/blob/main/PUBLISHING.md Upload distribution packages to the production PyPI repository after successful testing on TestPyPI. ```bash twine upload dist/* ``` -------------------------------- ### Run a SQL Query Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/commands/sql.mdx Execute a specific SQL query and display the results. Use this for ad-hoc data retrieval. ```bash sup sql "SELECT * FROM users LIMIT 10" ``` -------------------------------- ### Pulling Charts and Dependencies to Filesystem Source: https://github.com/preset-io/superset-sup/blob/main/README.md Use 'sup chart pull' to download charts along with their dependencies (datasets, databases) to your local filesystem. You can pull all your charts, charts matching a name pattern, or a specific chart by its ID. ```bash # Pull charts + dependencies to filesystem sup chart pull --mine # Pull your charts + datasets + # databases sup chart pull --name="*revenue*" # Pull revenue charts + # dependencies sup chart pull --id=3586 # Pull specific chart + # dependencies ``` -------------------------------- ### Sup Theme Banner Subcommand Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/commands/theme.mdx Use this subcommand to test the full banner with the current branding applied. ```bash sup theme banner ``` -------------------------------- ### Pull Dashboard with All Dependencies Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/guides/multi-asset.md Use this command to pull a specific dashboard along with all its associated charts, datasets, and database connection metadata. ```bash # Pull dashboard with all dependencies sup dashboard pull --ids 123 --include-deps # This pulls: # - Dashboard 123 # - All charts in the dashboard # - All datasets used by charts # - Database connections (metadata only) ``` -------------------------------- ### Basic Usage of sup role Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/commands/role.mdx Displays the general usage of the sup role command, outlining its structure and available subcommands. ```bash sup role [COMMAND] [OPTIONS] ``` -------------------------------- ### preset_cli.cli.superset.sync.dbt.lib.build_bigquery_sqlalchemy_params Source: https://github.com/preset-io/superset-sup/blob/main/docs/api/preset_cli.cli.superset.sync.dbt.md Builds SQLAlchemy connection parameters for a BigQuery target. ```APIDOC ## preset_cli.cli.superset.sync.dbt.lib.build_bigquery_sqlalchemy_params ### Description Build the SQLAlchemy URI for a BigQuery target. Currently supports only configuration via `keyfile`. ### Parameters * **target** (Dict[str, Any]) - Required - The dbt target configuration. ### Returns * **Dict[str, Any]** - SQLAlchemy connection parameters for BigQuery. ``` -------------------------------- ### preset_cli.cli.superset.sync.dbt.lib.build_redshift_sqlalchemy_params Source: https://github.com/preset-io/superset-sup/blob/main/docs/api/preset_cli.cli.superset.sync.dbt.md Builds SQLAlchemy connection parameters for a Redshift target. ```APIDOC ## preset_cli.cli.superset.sync.dbt.lib.build_redshift_sqlalchemy_params ### Description Build the SQLAlchemy URI for a Redshift target. ### Parameters * **target** (Dict[str, Any]) - Required - The dbt target configuration. ### Returns * **Dict[str, Any]** - SQLAlchemy connection parameters for Redshift. ``` -------------------------------- ### PresetClient Source: https://github.com/preset-io/superset-sup/blob/main/docs/api/preset_cli.api.clients.md A client for interacting with the Preset API, enabling management of teams, users, and workspaces. ```APIDOC ## PresetClient ### Description A client for the Preset API. ### Methods #### change_team_role(team_name: str, user_id: int, role_id: int) Change the team role of a given user. #### change_workspace_role(team_name: str, workspace_id: int, user_id: int, role_identifier: str) Change the workspace role of a given user. #### export_users(workspace_url: URL) Return all users from a given workspace. #### get_base_url(version: str | None = 'v1') Return the base URL for API calls. #### get_group_membership(team_name: str, page: int) Lists all user/SCIM groups associated with a team. #### get_team_members(team_name: str) Retrieve all users for a given team. #### get_teams() Retrieve all teams based on membership. #### get_workspaces(team_name: str) Retrieve all workspaces for a given team. #### import_users(teams: List[str], users: List[UserType]) Import users by adding them via SCIM. #### invite_users(teams: List[str], emails: List[str], role_id=Role.USER) Invite users to teams. ``` -------------------------------- ### Clean and Rebuild for Version Conflicts Source: https://github.com/preset-io/superset-sup/blob/main/PUBLISHING.md If encountering 'File already exists' errors on PyPI, indicating a version re-upload attempt, clean the build artifacts and rebuild the distribution packages. ```bash rm -rf dist/ && python -m build ``` -------------------------------- ### Push Users via SCIM Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/commands/user.mdx Imports users from a YAML file using the SCIM protocol. This facilitates automated user provisioning. ```bash sup user push ``` -------------------------------- ### dbt Command Line Interface Source: https://github.com/preset-io/superset-sup/blob/main/docs-site/src/content/docs/commands/dbt.mdx The base command for interacting with dbt synchronization features. ```bash sup dbt [COMMAND] [OPTIONS] ```