Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Comments

Fix database setting in PostgresDatabase#1276

Merged
pankajastro merged 5 commits intomainfrom
fix_pg
Nov 21, 2022
Merged

Fix database setting in PostgresDatabase#1276
pankajastro merged 5 commits intomainfrom
fix_pg

Conversation

@pankajastro
Copy link
Contributor

@pankajastro pankajastro commented Nov 21, 2022

Description

What is the current behavior?

Currently, the CI is failing for postgres related tests, because the postgres database is set to the table schema.

More details:

In 313f6da#diff-9fcbc9dc6fc68bf0a0d62a485508779f5b1f6d749a197e0f1ab1758983d1eb1e we added kwargs.update({"database" but PostgresHook did not support database kwarg at that time. This is why it basically did not do anything. Now after apache/airflow#26744 got released in the latest provider, it is being picked up and it shows that we wrongly set {"database": self.table.metadata.schema}

What is the new behavior?

We correctly set the database to the table's database.

Does this introduce a breaking change?

No.

Checklist

  • Created tests which fail without the change (if possible)
  • Extended the README / documentation, if necessary

@pankajastro pankajastro changed the title [Test] fix postgres schema fix postgres schema Nov 21, 2022
@codecov
Copy link

codecov bot commented Nov 21, 2022

Codecov Report

Base: 94.74% // Head: 94.74% // No change to project coverage 👍

Coverage data is based on head (d21674c) compared to base (f639ba5).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1276   +/-   ##
=======================================
  Coverage   94.74%   94.74%           
=======================================
  Files          70       70           
  Lines        3236     3236           
  Branches      378      378           
=======================================
  Hits         3066     3066           
  Misses        106      106           
  Partials       64       64           
Impacted Files Coverage Δ
python-sdk/src/astro/databases/postgres.py 96.55% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@feluelle feluelle marked this pull request as ready for review November 21, 2022 10:39
@feluelle feluelle changed the title fix postgres schema Fix database setting in PostgresDatabase Nov 21, 2022
@pankajastro pankajastro merged commit b452f15 into main Nov 21, 2022
@pankajastro pankajastro deleted the fix_pg branch November 21, 2022 11:13
@sunank200
Copy link
Contributor

Created an issue to check the backward compatibility for PostGresHook: #1291

@sunank200 sunank200 added this to the 1.2.3 milestone Nov 23, 2022
sunank200 pushed a commit that referenced this pull request Nov 23, 2022
# Description

## What is the current behavior?

Currently, the CI is failing for postgres related tests, because the
postgres database is set to the table schema.

**More details:**

In
313f6da#diff-9fcbc9dc6fc68bf0a0d62a485508779f5b1f6d749a197e0f1ab1758983d1eb1e
we added `kwargs.update({"database"` but PostgresHook did not support
`database` kwarg at that time. This is why it basically did not do
anything. Now after apache/airflow#26744 got
released in the latest provider, it is being picked up and it shows that
we wrongly set `{"database": self.table.metadata.schema}`

## What is the new behavior?

We correctly set the database to the table's database.

## Does this introduce a breaking change?

No.

### Checklist
- [ ] Created tests which fail without the change (if possible)
- [ ] Extended the README / documentation, if necessary

(cherry picked from commit b452f15)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants