o-nikolas commented on a change in pull request #17325:
URL: https://github.com/apache/airflow/pull/17325#discussion_r688668942



##########
File path: airflow/providers/amazon/aws/hooks/s3.py
##########
@@ -75,15 +75,10 @@ def unify_bucket_name_and_key(func: T) -> T:
     def wrapper(*args, **kwargs) -> T:
         bound_args = function_signature.bind(*args, **kwargs)
 
-        def get_key_name() -> Optional[str]:
-            if 'wildcard_key' in bound_args.arguments:
-                return 'wildcard_key'
-            if 'key' in bound_args.arguments:
-                return 'key'
+        key_name = 'wildcard_key' if 'wildcard_key' in bound_args.arguments 
else 'key'
+        if key_name not in bound_args.arguments:

Review comment:
       I agree with @uranusjr, I don't see a reason to make this code more 
cryptic in this particular case, just to save a few lines. I'd use the same 
cascading if statements that were present before your changes (and that 
@uranusjr is suggesting).




-- 
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]


Reply via email to