uranusjr commented on code in PR #23675:
URL: https://github.com/apache/airflow/pull/23675#discussion_r871593552
##########
airflow/providers/amazon/aws/hooks/batch_waiters.py:
##########
@@ -120,7 +120,7 @@ def default_config(self) -> Dict:
:rtype: Dict
"""
if self._default_config is None:
- config_path =
Path(__file__).with_name("batch_waiters.json").absolute()
+ config_path =
Path(__file__).with_name("batch_waiters.json").resolve()
with open(config_path) as config_file:
self._default_config = json.load(config_file)
Review Comment:
We don’t even need to resolve here, this should just work:
```python
with Path(__file__).with_name("batch_waiters.json").open() as config_file:
self._default_config = json.load(config_file)
```
##########
tests/utils/test_db_cleanup.py:
##########
@@ -208,7 +208,7 @@ def test_no_models_missing(self):
"""
import pkgutil
- proj_root = Path(__file__).parents[2].absolute()
+ proj_root = Path(__file__).parents[2].resolve()
Review Comment:
Likely the same here as well.
##########
scripts/ci/pre_commit/pre_commit_check_pre_commit_hooks.py:
##########
@@ -25,7 +25,7 @@
import sys
from pathlib import Path
-sys.path.insert(0, str(Path(__file__).parent.absolute())) # make sure
common_precommit_utils is imported
+sys.path.insert(0, str(Path(__file__).parent.resolve())) # make sure
common_precommit_utils is imported
Review Comment:
Same here, `sys.path` accepts a relative path just fine and I don’t think we
need to convert. (There are several places using this pattern and this should
apply to them all.)
--
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]