potiuk commented on code in PR #36259:
URL: https://github.com/apache/airflow/pull/36259#discussion_r1429047695


##########
airflow/io/store/__init__.py:
##########
@@ -48,15 +49,17 @@ def __init__(
     ):
         self.conn_id = conn_id
         self.protocol = protocol
-        self._fs = fs
+        if fs is not None:
+            self.fs = fs

Review Comment:
   NIT: Maybe it would be good to add a comment (at least until we have 3.8) 
that this is going to work because of `@cached_property` implementation which 
is (as of 3.9) documented but it was an implementation detail in 3.8. 
   
   Compare:
   
   https://docs.python.org/3.9/library/functools.html#functools.cached_property
   
   with:
   
   https://docs.python.org/3.8/library/functools.html#functools.cached_property
   
   That was added in 3.9 only (but 3.8 worked this way as well).
   
   ```
   Th cached_property decorator only runs on lookups and only when an attribute 
of the same name doesn’t
   exist. When it does run, the cached_property writes to the attribute with 
the same name. Subsequent 
   attribute reads and writes take precedence over the cached_property method 
and it works like a normal 
   attribute. 
   ```



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