This is an automated email from the ASF dual-hosted git repository.
husseinawala pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 39cbd6b231 Add `get_ui_field_behaviour()` method to PostgresHook
(#34811)
39cbd6b231 is described below
commit 39cbd6b231c75ec432924d8508f15a4fe3c68757
Author: Pubudu Fernando <[email protected]>
AuthorDate: Mon Oct 9 00:54:05 2023 +0530
Add `get_ui_field_behaviour()` method to PostgresHook (#34811)
* Add get_ui_field_behaviour() method to PostgresHook
* Update the PostgreSQL Connection doc page
---------
Co-authored-by: Hussein Awala <[email protected]>
---
airflow/providers/postgres/hooks/postgres.py | 9 +++++++++
docs/apache-airflow-providers-postgres/connections/postgres.rst | 2 +-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/airflow/providers/postgres/hooks/postgres.py
b/airflow/providers/postgres/hooks/postgres.py
index ecdd331f9e..1d9cd69d2b 100644
--- a/airflow/providers/postgres/hooks/postgres.py
+++ b/airflow/providers/postgres/hooks/postgres.py
@@ -362,3 +362,12 @@ class PostgresHook(DbApiHook):
def get_openlineage_default_schema(self) -> str | None:
"""Returns current schema. This is usually changed with
``SEARCH_PATH`` parameter."""
return self.get_first("SELECT CURRENT_SCHEMA;")[0]
+
+ @staticmethod
+ def get_ui_field_behaviour() -> dict[str, Any]:
+ return {
+ "hidden_fields": [],
+ "relabeling": {
+ "schema": "Database",
+ },
+ }
diff --git a/docs/apache-airflow-providers-postgres/connections/postgres.rst
b/docs/apache-airflow-providers-postgres/connections/postgres.rst
index fa38f998e9..111f0a3f5e 100644
--- a/docs/apache-airflow-providers-postgres/connections/postgres.rst
+++ b/docs/apache-airflow-providers-postgres/connections/postgres.rst
@@ -28,7 +28,7 @@ Configuring the Connection
Host (required)
The host to connect to.
-Schema (optional)
+Database (optional)
Specify the name of the database to connect to.
.. note::