Skip to content
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

V4SymphonyElementAction automatically transform strings to datetime and other types #344

Closed
anthony-symphony opened this issue Oct 25, 2024 · 0 comments · Fixed by #345
Closed

Comments

@anthony-symphony
Copy link
Contributor

anthony-symphony commented Oct 25, 2024

Bug Report

Steps to Reproduce:

  1. Create a messageML with a text-field.
  2. Fill out the text-field with something that can be transformed to a datetime such as 20251023
  3. Create and start Reading from Datafeed
  4. Fill out form with 20251023 and submit

Alternatively:

  1. Generate Python Bot with the Symphony Bot Generator
  2. Send @mention /gif
  3. Fill out form with 20251023 and submit.

Expected Result:

The value should come in as a String and let the developer action against it as there is nothing in the response that indicates what type it should be. The type should not be inferred.

For the generated Python BDK:
Expected result is that it should return with "Category is 20251023"

Actual Result:

The type is being inferred. Even though I put 20251023 and it can be inferred to be a valid date, in this case I am not expecting a datetime as it could be an ID or something else.

For the generated Python BDK after hitting submit you get "Category is 2025-10-23" which shows it being transformed to a datetime.

Environment:

Python 3.11.1
Windows 10
symphony_bdk_python 2.7.1

Additional Context:

Modifying Lines 90 and 263 of v4_symphony_elements_action.py to only include str and none_type fixes this issue but, may be considered a breaking change as there may developers currently expecting us to transform it to datetimes and other types.

'form_values': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type), # noqa: E501

'form_values': ({str: (str, none_type)}, none_type), # noqa: E501

self.form_values: Union[{str: (bool, date, datetime, dict, float, int, list, str, none_type)}] = None

self.form_values: Union[{str: (str, none_type)}] = None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant