Magics

Note

You must be authenticated towards the appropriate cloud provider for the magics to work.

Note

Most magics fall back to using configuration values in the [tool.mindlab] section of the pyproject.toml file when an argument has not been provided (e.g. for the organization value). Additionally, you can also specify a configuration option that applies to a single magic method by prefixing it with the name of the magic (e.g. athena_organization or athena_region).

Tip

You can list all available magics by typing %lsmagic into a cell. You can also display the documentation of any magic by prefixing it with a question mark (like ?bigquery).

%mindlab_config [name] [value]

Manage MindLab configuration.

Setting a configuration value has the same effect as adding it to the tool.mindlab section of the pyproject.toml file.

Positional arguments:
name

Name of the configuration value to get or set

value

New configuration value

%%athena [-o ORGANIZATION] [-t] [-i] [-r REGION] [-d DATABASE] [-w WORKGROUP] [output]

Run an Amazon Athena query.

Positional arguments:
output

Name of the variable in which to store the output

Named arguments:
-o, --organization

The organization to use

-t, --transpose

Display the data frame transposed

-i, --info

Display additional query information

-r, --region

The region to use

-d, --database

The database to use

-w, --workgroup

The workgroup to use

%%bigquery [-o ORGANIZATION] [-t] [-i] [-p PROJECT] [output]

Run a Google BigQuery query.

Positional arguments:
output

Name of the variable in which to store the output

Named arguments:
-o, --organization

The organization to use

-t, --transpose

Display the data frame transposed

-i, --info

Display additional query information

-p, --project

The project to use

%%redshift [-o ORGANIZATION] [-t] [-i] [-r REGION] [-c CONNECTION] [output]

Run an Amazon Redshift query.

Positional arguments:
output

Name of the variable in which to store the output

Named arguments:
-o, --organization

The organization to use

-t, --transpose

Display the data frame transposed

-i, --info

Display additional query information

-r, --region

The region to use

-c, --connection

The Glue connection to use