SegmentHook

Segment

Create new connection to Segment and allows you to pull data out of Segment or write to it.

View Source

Last Updated: Dec. 8, 2020

Access Instructions

Install the Segment provider package into your Airflow environment.

Import the module into your DAG file and instantiate it with your desired params.

Parameters

segment_conn_idstrthe name of the connection that has the parameters we need to connect to Segment. The connection should be type json and include a write_key security token in the Extras field.
segment_debug_modeboolDetermines whether Segment should run in debug mode. Defaults to False

Documentation

Create new connection to Segment and allows you to pull data out of Segment or write to it.

You can then use that file with other Airflow operators to move the data around or interact with segment.

Note

You must include a JSON structure in the Extras field. We need a user’s security token to connect to Segment. So we define it in the Extras field as: {“write_key”:”YOUR_SECURITY_TOKEN”}

Example DAGs

Improve this module by creating an example DAG.

View Source
  1. Add an `example_dags` directory to the top-level source of the provider package with an empty `__init__.py` file.
  2. Add your DAG to this directory. Be sure to include a well-written and descriptive docstring
  3. Create a pull request against the source code. Once the package gets released, your DAG will show up on the Registry.

Was this page helpful?