Tailer Documentation
  • What is Tailer Platform?
  • Getting Started
    • Prepare your local environment for Tailer
    • Install Tailer SDK
    • Set up Google Cloud Platform
    • Encrypt your credentials
  • [Tutorial] Create a first data pipeline
    • Introduction
    • Prepare the demonstration environment
    • Copy files from one bucket to another
    • Load files into BigQuery tables
    • Prepare data
    • Build predictions
    • Export data
    • Congratulations!
    • [Video] Automatic Script
      • SQL script file
      • DDL script file
      • Tables to Tables script file
      • Launch configuration and furthermore
  • Data Pipeline Operations
    • Overview
    • Set constants with Context
      • Context configuration file
    • Move files with Storage to Storage
      • Storage to Storage configuration file
    • Load data with Storage to Tables
      • Storage to Tables configuration file
      • Storage to Tables DDL files
    • Stream incoming data with API To Storage
      • API To Storage configuration file
      • API To Storage usage examples
    • Transform data with Tables to Tables
      • Tables to Tables configuration file
      • Table to Table SQL and DDL files
    • Export data with Tables to Storage
      • [V3] Table to Storage configuration file
      • Table to Storage SQL file
      • [V1-V2: deprecated] Table to Storage configuration file
    • Orchestrate processings with Workflow
      • [V2] Workflow configuration file
      • [V1: deprecated] Workflow configuration file
    • Convert XML to CSV
      • Convert XML to CSV configuration file
    • Use advanced features with VM Launcher
      • Process code with VM Launcher
        • VM Launcher configuration file for code processing
      • Encrypt/Decrypt data with VM Launcher
        • VM Launcher configuration file for data encryption
        • VM Launcher configuration file for data decryption
    • Monitoring and Alerting
      • Monitoring and alerting parameters
    • Asserting Data quality with Expectations
      • List of Expectations
    • Modify files with File Utilities
      • Encrypt/Decrypt data with File Utilities
        • Configuration file for data encryption
        • Configuration file for data decryption
    • Transfer data with GBQ to Firestore
      • Table to Storage: configuration file
      • Table to Storage: SQL file
      • VM Launcher: configuration file
      • File-to-firestore python file
  • Tailer Studio
    • Overview
    • Check data operations' details
    • Monitor data operations' status
    • Execute data operations
    • Reset Workflow data operations
    • Archive data operations
    • Add notes to data operations and runs
    • View your data catalog
    • Time your data with freshness
  • Tailer API
    • Overview
    • Getting started
    • API features
  • Release Notes
    • Tailer SDK Stable Releases
    • Tailer Beta Releases
      • Beta features
      • Beta configuration
      • Tailer SDK API
    • Tailer Status
Powered by GitBook
On this page
  • What is a Context?
  • ✅ Supported data operations
  • ⚙️ How it works
  • 📋 How to set and use a constant

Was this helpful?

Edit on GitHub
  1. Data Pipeline Operations

Set constants with Context

Learn how to set constants with the Context data operation.

PreviousOverviewNextContext configuration file

Last updated 1 year ago

Was this helpful?

What is a Context?

Before getting started with the creation of your data pipeline operations, you can first set constants using a Context configuration.

Constants are objects which act as placeholders. Their value is stored through a Context configuration, and can be called in all your subsequent data operation configurations. When you deploy a data operation, you are asked the Context you want to use. The constants are then replaced by their value according to the Context.

Constants can be used for example to replace GCP credential parameters so they can remain confidential, to manage different GCS bucket names for development and production environnement, etc.

✅ Supported data operations

All data operations can contain the constants set with Context.

When you want to apply context to your configurations, you should always make sure than the latest version is specified. For example, add in you configuration"version": "3"for a table-to-storage configuration.

⚙️ How it works

You set a constant as follows through a Context data operation:

"test_integer": {
			"value": 123456,
			"type": "integer",
			"resource": "value",
			"description": "Some random value"
		}

Once you have deployed your Context configuration, you can start using the constants it contains in your other data operations using the name of the constant wrapped in double curly brackets. For example, to set the max_active_run to your "test_integer":

"max_active_runs": {{test_integer}}

make sure there is no space between your constant and the brackets

{{test_integer}} -> OK
{{ test_integer }} -> KO

When you deploy a configuration file, you will be asked the Context you want to use. The constants are then replaced by the values defined in the Context configuration.

You can use the constants in the SQL files of your table-to-table and table-to-storage, for example:

SELECT * FROM {{bq_dataset}}.my_table

There are two generic constants you can use in a your data operation configurations without setting them explicitly in your Context configuration:

  • {{FD_ACCOUNT}} will take the value of the "account" parameter of your Context configuration

  • {{FD_ENV}} will take the value of the "environment" parameter of your Context configuration

  • {{FD_CONTEXT}} will take the value of the "context" parameter of your Context configuration

When you deploy a configuration using a Context, the ID of the configuration deployed in Tailer is the concatenation of the Context's account_id, the Context's configuration_id, your data operation's configuration_id and your data operation's environment. With this concatenation, you don't risk to erase configurations for different contexts.

Please note that you cannot define the following custom constant:

  • any constant prefixed with FD_

  • the protected name : TEMPLATE_CURRENT_DATE

📋 How to set and use a constant

  1. Create a working folder as you want, and create a JSON file for your Context data operation inside.

  2. Access your working folder by running the following command:

    cd "[path to your working folder]"
  3. To deploy the Context data operation, run the following command:

    tailer deploy configuration your-file.json
  4. You can now use your constants in other data operation configurations files. Dont forget to add "version" : "2" for STS, STT, TTT and TTS data operations. If your constant is a string, do not forget to include them wrapped in double quotes, for example: "gcp_project_id": "{{gcp_dlk_project_id}}"

  5. You can now deploy your configuration file. You will be asked the Context you want to use. If you want to skip this question, you can use the --context flag when you deploy, for example: tailer deploy configuration your-data-operation.json --context your-context-name

Access your tailer folder (created during ).

Set all the required constants in your JSON configuration file. Refer to this page to learn about all the .

Log in to to check the status and details of your data operation.

💡
installation
parameters
Tailer Studio