Task One: Create Postgres Table (if none exists).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Task One: Create Postgres Table (if none exists). | |
task_one = PostgresOperator( | |
task_id = 'create_table', | |
sql = '''CREATE TABLE IF NOT EXISTS public.earthquake_events ( | |
event_id VARCHAR(50) NOT NULL, | |
event_name VARCHAR(160) NOT NULL, | |
magnitude DECIMAL NOT NULL, | |
longitude DECIMAL NOT NULL, | |
latitude DECIMAL NOT NULL, | |
date DATE NOT NULL);''', | |
postgres_conn_id = 'postgres_default', | |
database = Variable.get("USGS_DB_NAME") | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment