astronomer / airflow-provider-great-expectations

Great Expectations Airflow operator
http://greatexpectations.io
Apache License 2.0
159 stars 54 forks source link

Pull the database name for the Postgres connection only from the connection definition #117

Closed TJaniF closed 12 months ago

TJaniF commented 1 year ago

Background: the Airflow Postgres connection uses the schema parameter to specify the database (see: https://airflow.apache.org/docs/apache-airflow-providers-postgres/stable/connections/postgres.html). This lead to a double use of the self.schema attribute in the operator in case of using it with postgres, both for the database and the schema which in effect meant if those values were not the same it did not work.

This PR changes the postgres connection to use the schema parameter defined in the connection itself as the database name and use the schema parameter of the operator (or a schema.table notation for the data_asset parameter) as the schema within the GX context.