-
Notifications
You must be signed in to change notification settings - Fork 5k
Closed
Labels
PyschedulerStaleimprovementmake more easy to user or prompt friendlymake more easy to user or prompt friendly
Description
Search before asking
- I had searched in the issues and found no similar issues.
What happened
When I write a code as below and pass funtion largest_size to Python arg definition, is should work because my code is correctly. But it failed because of python task can not get variable and libariy we already decalere.
from pathlib import Path
download_dir = "/tmp/demo"
store_dir = "dolphinscheduler"
def largest_size():
result = (None, 0)
paths = Path(download_dir).joinpath(store_dir).glob("**/*")
for path in paths:
# skip is path is directory
if path.is_dir():
continue
file_size = path.stat().st_size
if result[0] is None or file_size > result[1]:
result = (path.name, file_size)
print(result)to make it work, I have to change to
- from pathlib import Path
- download_dir = "/tmp/demo"
- store_dir = "dolphinscheduler"
def largest_size():
+ from pathlib import Path
+
+ download_dir = "/tmp/demo"
+ store_dir = "dolphinscheduler"
result = (None, 0)
paths = Path(download_dir).joinpath(store_dir).glob("**/*")
for path in paths:
# skip is path is directory
if path.is_dir():
continue
file_size = path.stat().st_size
if result[0] is None or file_size > result[1]:
result = (path.name, file_size)
print(result)this is not very user firendly
What you expected to happen
ATT
How to reproduce
ATT
Anything else
ATT
Version
dev
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
PyschedulerStaleimprovementmake more easy to user or prompt friendlymake more easy to user or prompt friendly