shahar1 commented on code in PR #66930: URL: https://github.com/apache/airflow/pull/66930#discussion_r3318902879
########## providers/google/tests/system/google/cloud/gcs/example_gdrive_to_gcs.py: ########## Review Comment: The issue is in the hook's `get_file_id` method: https://github.com/apache/airflow/blob/main/providers/google/src/airflow/providers/google/suite/hooks/drive.py#L227-L229 The problematic code: ```python query = f"name = '{file_name}'" if folder_id: # Empty string "" evaluates to False query += f" and parents in '{folder_id}'" ``` When `FOLDER_ID = ""` (empty string), the condition `if folder_id:` is `False`, so the folder filter is never added to the query. With `drive_id` provided but no folder constraint, the search runs across the entire shared drive by name only, which can return the wrong file if multiple files with the same name exist. Even though the file name includes `ENV_ID`, it can still hit the wrong 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
