Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix postgres part of pipeline example of tutorial #21586

Merged
merged 3 commits into from
Feb 15, 2022

Conversation

KevinYanesG
Copy link
Contributor

related: #21457

After a discussion with @potiuk, we figured out how to include the explicit creation of the postgres tables into the tutorial.

One remark that I need to write here is that I couldn't manage it to work with a LOCAL connection, but instead I used the postgres_default. Maybe it is a bad practice and should be corrected, I just put it as an alternative, because it worked for me.

Copy link
Member

@potiuk potiuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks really cool!

@github-actions github-actions bot added the okay to merge It's ok to merge this PR as it does not require more tests label Feb 15, 2022
@github-actions
Copy link

The PR is likely ready to be merged. No tests are needed as no important environment files, nor python files were modified by it. However, committers might decide that full test matrix is needed and add the 'full tests needed' label. Then you should rebase it to the latest main or amend the last commit of the PR, and push it with --force-with-lease.

@potiuk
Copy link
Member

potiuk commented Feb 15, 2022

One remark that I need to write here is that I couldn't manage it to work with a LOCAL connection, but instead I used the postgres_default. Maybe it is a bad practice and should be corrected, I just put it as an alternative, because it worked for me.

I think It's even better to leave postgres_default. It's a good practice for anyone who starts their adventure with Airflow. I will make a suggestion for it.

Comment on lines 376 to 386
We need to add a connection to Postgres. Go to the UI and click "Admin" >> "Connections". Specify the following for each field:

- Conn id: LOCAL
- Conn Type: postgres
- Host: postgres
- Schema: <DATABASE_NAME>
- Login: airflow
- Password: airflow
- Port: 5432

Alternatively, you can use the postgres_default connection. If one uses this, one should change the value of ``postgres_conn_id`` in the DAG definition:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
We need to add a connection to Postgres. Go to the UI and click "Admin" >> "Connections". Specify the following for each field:
- Conn id: LOCAL
- Conn Type: postgres
- Host: postgres
- Schema: <DATABASE_NAME>
- Login: airflow
- Password: airflow
- Port: 5432
Alternatively, you can use the postgres_default connection. If one uses this, one should change the value of ``postgres_conn_id`` in the DAG definition:
You can use the postgres_default connection. You should change the value of ``postgres_conn_id`` in the DAG definition:

Copy link
Member

@potiuk potiuk Feb 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's OK to use "postgres_default" only for it.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review!
One small comment: In this case, maybe in the code postgres_conn_id=LOCAL should be changed to postgres_conn_id=postgres_default for complete correctness :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. Feel free to fixup :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now, it should be fine!

@potiuk potiuk merged commit 40028f3 into apache:main Feb 15, 2022
@jedcunningham jedcunningham added the type:doc-only Changelog: Doc Only label Feb 28, 2022
@jedcunningham jedcunningham added this to the Airflow 2.2.5 milestone Feb 28, 2022
ephraimbuddy pushed a commit that referenced this pull request Mar 16, 2022
ephraimbuddy pushed a commit that referenced this pull request Mar 20, 2022
ephraimbuddy pushed a commit that referenced this pull request Mar 22, 2022
ephraimbuddy pushed a commit that referenced this pull request Mar 22, 2022
ephraimbuddy pushed a commit that referenced this pull request Mar 22, 2022
ephraimbuddy pushed a commit that referenced this pull request Mar 22, 2022
ephraimbuddy pushed a commit that referenced this pull request Mar 24, 2022
ephraimbuddy pushed a commit that referenced this pull request Mar 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:documentation okay to merge It's ok to merge this PR as it does not require more tests type:doc-only Changelog: Doc Only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants