kaxil commented on a change in pull request #11135:
URL: https://github.com/apache/airflow/pull/11135#discussion_r494553252
##########
File path: airflow/providers/salesforce/hooks/salesforce.py
##########
@@ -75,7 +76,7 @@ def get_conn(self):
)
return self.conn
- def make_query(self, query, include_deleted=False, query_params=None):
+ def make_query(self, query: str, include_deleted: bool = False,
query_params: Optional[Dict] = None) -> Dict:
Review comment:
```suggestion
def make_query(self, query: str, include_deleted: bool = False,
query_params: Optional[dict] = None) -> dict:
```
We could just keep it as `dict` since that is same as Dict[Any, Any] (and
same as Dict)
##########
File path: airflow/providers/salesforce/hooks/salesforce.py
##########
@@ -100,7 +101,7 @@ def make_query(self, query, include_deleted=False,
query_params=None):
return query_results
- def describe_object(self, obj):
+ def describe_object(self, obj: str) -> Dict:
Review comment:
```suggestion
def describe_object(self, obj: str) -> dict:
```
##########
File path: airflow/providers/salesforce/hooks/salesforce.py
##########
@@ -130,7 +131,7 @@ def get_available_fields(self, obj):
return [field['name'] for field in obj_description['fields']]
- def get_object_from_salesforce(self, obj, fields):
+ def get_object_from_salesforce(self, obj: str, fields: Iterable[str]) ->
Dict:
Review comment:
```suggestion
def get_object_from_salesforce(self, obj: str, fields: Iterable[str]) ->
dict:
```
##########
File path: airflow/providers/salesforce/hooks/salesforce.py
##########
@@ -193,8 +194,13 @@ def _to_timestamp(cls, column):
return pd.Series(converted, index=column.index)
def write_object_to_file(
- self, query_results, filename, fmt="csv", coerce_to_timestamp=False,
record_time_added=False
- ):
+ self,
+ query_results: List[Dict],
Review comment:
```suggestion
query_results: List[dict],
```
##########
File path: airflow/providers/salesforce/hooks/salesforce.py
##########
@@ -270,7 +276,12 @@ def write_object_to_file(
return df
- def object_to_df(self, query_results, coerce_to_timestamp=False,
record_time_added=False):
+ def object_to_df(
+ self,
+ query_results: List[Dict],
Review comment:
```suggestion
query_results: List[dict],
```
##########
File path: airflow/providers/salesforce/operators/tableau_refresh_workbook.py
##########
@@ -14,7 +14,7 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-from typing import Optional
+from typing import Optional, Any, Dict
Review comment:
Do we need this imports, looks like Any and Dict are not used in this
file
##########
File path: airflow/providers/salesforce/operators/tableau_refresh_workbook.py
##########
@@ -14,7 +14,7 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-from typing import Optional
+from typing import Optional, Any, Dict
Review comment:
Do we need these imports, looks like Any and Dict are not used in this
file
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]