Skip to content

Refactor os.path.splitext to Path.* - #34352

Merged
uranusjr merged 1 commit into
apache:mainfrom
eumiro:splitext
Sep 15, 2023
Merged

Refactor os.path.splitext to Path.*#34352
uranusjr merged 1 commit into
apache:mainfrom
eumiro:splitext

Conversation

@eumiro

@eumiroeumiro commented Sep 13, 2023

Copy link
Copy Markdown
Contributor

With Python 3.9+ we can change that:

pidlock_path=pid_path.with_name(f"{pid_path.stem}-monitor{pid_path.suffix}")

to

pidlock_path=pid_path.with_stem(f"{pid_path.stem}-monitor")

@boring-cyborgboring-cyborgBot added area:CLI area:Scheduler including HA (high availability) scheduler area:webserver Webserver related Issues kind:documentation labels Sep 13, 2023
@eumiro
eumiro marked this pull request as ready for review September 14, 2023 18:15

@hussein-awalahussein-awala left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

)
self._file_stats[processor.file_path] = stat

file_name = os.path.splitext(os.path.basename(processor.file_path))[0].replace(os.sep, ".")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The final replace call is so weird… Since basename is called, the value just can never contain an os.sep in the first place.

@uranusjr
uranusjr merged commit 4869575 into apache:mainSep 15, 2023
@eumiro
eumiro deleted the splitext branch September 15, 2023 14:49
@ephraimbuddyephraimbuddy added this to the Airflow 2.7.2 milestone Oct 3, 2023
@ephraimbuddyephraimbuddy added the type:misc/internal Changelog: Misc changes that should appear in change log label Oct 3, 2023
ephraimbuddy pushed a commit that referenced this pull request Oct 5, 2023
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:CLIarea:Schedulerincluding HA (high availability) schedulerarea:webserverWebserver related Issueskind:documentationtype:misc/internalChangelog: Misc changes that should appear in change log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@eumiro@uranusjr@ephraimbuddy@Lee-W@hussein-awala