astronomer-cosmos
astronomer-cosmos copied to clipboard
refactor: remove duplicated _construct_dest_file_path
Description
Refactor destination path construction for remote object storage uploads in the Astronomer Cosmos library.
- a new helper function
construct_dest_file_path()incosmos/io.py, responsible for normalizing and building destination paths for artifact upload. - Remove duplicated
_construct_dest_file_pathlogic from the local dbt operator class; instead reuse the shared helper to keep both upload and local operator path logic - Add a unit test (
tests/test_io.py) covering_construct_dest_file_path()
Related Issue(s)
closes #1746
Breaking Change?
No. This refactor preserves existing destination path semantics while changing internal implementation. Consumers invoking upload methods or operators will see no behavior change.
Checklist
- [ ] I have made corresponding changes to the documentation (if required)
- [x] I have added tests that prove my fix is effective or that my feature works
Thanks a lot for doing this refactor, @jx2lee. Changes like this really help the Cosmos code base be easier to maintain.
I provided minor feedback inline, and I'm happy for us to merge this change once the tests pass.
Please, rebase based on the
mainbranch
@tatiana Thanks for waiting ! I was on a trip(🇯🇵), so update took a bit longer. Rebase is all done, too!
Deploy Preview for sunny-pastelito-5ecb04 canceled.
| Name | Link |
|---|---|
| Latest commit | c78dbf16eab206130b9bafae908f8c0da3a07f17 |
| Latest deploy log | https://app.netlify.com/projects/sunny-pastelito-5ecb04/deploys/6911ef828566270008b1277d |