-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flows are breaking in 0.21.2 for task io.kestra.plugin.scripts.python.Commands #7313
Comments
@loicmathieu let's have a look or assign someone else from the team, maybe an issue for Matt from dynamic properties change? |
This has been fixed in #7360, this was due to double-quotes inside a lit of String which was not correctly handled.
This one is strange and I cannot reproduce it either in develop or in 0.21.2. |
I update the kestra image tag in my compose file; are there more steps involved? in the flows I use task type: io.kestra.plugin.scripts.python.Commands |
Not, this is correct. |
A full track record in case I haven't clarified in my posts in the Slack channel;
|
For reference, here is a sample flow (long commands with python script), it works fine on develop: id: hyena_482026
namespace: company.team
tasks:
- id: hello
type: io.kestra.plugin.scripts.python.Commands
inputFiles:
main.py: |
import argparse
import sys
def process_arguments(name, age, city, occupation, favorite_color, pet_name, hobby, coffee_preference, lucky_number):
print(f"\nPerson Information Summary:")
print(f"==========================")
print(f"Name: {name}")
print(f"Age: {age}")
print(f"Location: {city}")
print(f"Occupation: {occupation}")
print(f"Favorite Color: {favorite_color}")
print(f"Pet's Name: {pet_name}")
print(f"Hobby: {hobby}")
print(f"Coffee Preference: {coffee_preference}")
print(f"Lucky Number: {lucky_number}")
def main():
parser = argparse.ArgumentParser(description='Process multiple personal information arguments')
# Adding arguments
parser.add_argument('--name', type=str, required=True, help='Person\'s name')
parser.add_argument('--age', type=int, required=True, help='Person\'s age')
parser.add_argument('--city', type=str, required=True, help='City of residence')
parser.add_argument('--occupation', type=str, required=True, help='Current occupation')
parser.add_argument('--favorite-color', type=str, required=True, help='Favorite color')
parser.add_argument('--pet-name', type=str, required=True, help='Pet\'s name')
parser.add_argument('--hobby', type=str, required=True, help='Favorite hobby')
parser.add_argument('--coffee', type=str, required=True, help='Coffee preference')
parser.add_argument('--lucky-number', type=int, required=True, help='Lucky number')
args = parser.parse_args()
# Process the arguments
process_arguments(
args.name,
args.age,
args.city,
args.occupation,
args.favorite_color,
args.pet_name,
args.hobby,
args.coffee,
args.lucky_number
)
if __name__ == "__main__":
main()
commands:
- python main.py --name "John Doe" --age 30 --city "New York" --occupation "Developer" --favorite-color "Blue" --pet-name "Max" --hobby "Reading" --coffee "Black" --lucky-number 7 |
a) Have you tried starting from 0.20 with such a flow and upgrade to 0.21.2? |
Multi-line invocation works on develop. Not sure about starting from 0.20, upgrading to 0.21.2 yet |
will try to get a screencast later today... |
Ok, I'm able to reproduce:
Editing the flow solves it, but still an issue as you might not want to edit all your flows manually... https://share.descript.com/view/sL3tLGb83yU Also the flow with breaking lines and pebble expressions: id: hyena_482026
namespace: company.team
variables:
luck_number: 7
tasks:
- id: hello
type: io.kestra.plugin.scripts.python.Commands
inputFiles:
main.py: |
import argparse
import sys
def process_arguments(name, age, city, occupation, favorite_color, pet_name, hobby, coffee_preference, lucky_number):
print(f"\nPerson Information Summary:")
print(f"==========================")
print(f"Name: {name}")
print(f"Age: {age}")
print(f"Location: {city}")
print(f"Occupation: {occupation}")
print(f"Favorite Color: {favorite_color}")
print(f"Pet's Name: {pet_name}")
print(f"Hobby: {hobby}")
print(f"Coffee Preference: {coffee_preference}")
print(f"Lucky Number: {lucky_number}")
def main():
parser = argparse.ArgumentParser(description='Process multiple personal information arguments')
# Adding arguments
parser.add_argument('--name', type=str, required=True, help='Person\'s name')
parser.add_argument('--age', type=int, required=True, help='Person\'s age')
parser.add_argument('--city', type=str, required=True, help='City of residence')
parser.add_argument('--occupation', type=str, required=True, help='Current occupation')
parser.add_argument('--favorite-color', type=str, required=True, help='Favorite color')
parser.add_argument('--pet-name', type=str, required=True, help='Pet\'s name')
parser.add_argument('--hobby', type=str, required=True, help='Favorite hobby')
parser.add_argument('--coffee', type=str, required=True, help='Coffee preference')
parser.add_argument('--lucky-number', type=int, required=True, help='Lucky number')
args = parser.parse_args()
# Process the arguments
process_arguments(
args.name,
args.age,
args.city,
args.occupation,
args.favorite_color,
args.pet_name,
args.hobby,
args.coffee,
args.lucky_number
)
if __name__ == "__main__":
main()
commands:
- python main.py --name "John Doe" \
- --age 30 --city "New York" --occupation "Developer" --favorite-color "Blue" --pet-name "Max" --hobby "Reading" --coffee "Black" --lucky-number {{ vars.luck_number }} |
Long commands are breaking the flows. Example follows:
To mitigate I had to break the lines, save the flow and then recombine to one line to be able to execute.
Important to note: lines with breaks are not running either; it appears as though arguments are missing.
If commands:
then i get the error:
The text was updated successfully, but these errors were encountered: