aritra24 commented on code in PR #36015:
URL: https://github.com/apache/airflow/pull/36015#discussion_r1414980129


##########
airflow/providers/common/sql/doc/adr/0002-return-common-data-structure-from-dbapihook-derived-hooks.md:
##########
@@ -0,0 +1,139 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+
+# 2. Return common data structure from DBApiHook derived hooks
+
+Date: 2023-12-01
+
+## Status
+
+Accepted
+
+## Context
+
+Note: This ADR describes the decision made (but not recorded) when common.sql 
provider has been

Review Comment:
   nit: had* been introduced



##########
airflow/providers/common/sql/doc/adr/0002-return-common-data-structure-from-dbapihook-derived-hooks.md:
##########
@@ -0,0 +1,139 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+
+# 2. Return common data structure from DBApiHook derived hooks
+
+Date: 2023-12-01
+
+## Status
+
+Accepted
+
+## Context
+
+Note: This ADR describes the decision made (but not recorded) when common.sql 
provider has been
+introduced in July 2022, but this ADR is recorded in December 2023 to make 
sure the decision is
+recorded.
+
+Before common.sql provider, we had a number of DBApi-derived Hooks which 
interfaced with Python
+DBAPI-compliant database and the format of data returned from these hooks were 
different and
+dependent on the implementation of the DBAPI interface as well as 
implementation of the Hooks and operators.
+We also had a lot of very similar operators that performed similar tasks - 
like Querying, Sensing the
+database, column check etc. This led to a lot of code duplication, and we 
decided that we need a common set
+of operators that can be used across all the DBAPI-compliant databases.
+
+Unfortunately there is no common standard for data returned by Python DBAPI 
interface. It's partially
+standardized by [PEP-0249](https://peps.python.org/pep-0249/), but the 
specification is not very
+strict and it allows for a lot of flexibility and interpretation. 
Consequently, the data returned
+by the DBAPI interface can contain tuples, named tuples, lists, dictionaries, 
or even custom objects and
+there are no guarantees that the data returned by the DBAPI interface is 
directly serializable.
+
+Not having a common standard format made it difficult to implement planned 
open-lineage column-level
+integration with the database Operators and - in later stage Hooks.
+
+## Decision
+
+We decided to introduce a common.sql provider that would contain a set of 
operators that can be used
+across all the DBAPI-compliant databases. We also decided that the return data 
structure from the

Review Comment:
   nit: returned* data structure



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to