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

[ISSUE] Decorator is not returning value from decorated function. #1

Open
lkellermann opened this issue Nov 1, 2022 · 0 comments
Open

Comments

@lkellermann
Copy link
Owner

Steps to reproduce:

  • Create a function that needs to return a value and decorate it.
  • Call the value of the function.

This can happen in Python 3.10.

Case study: a function which returns a dictionary from a string

2022-11-01 12:40:08,549 - Working directory:     /app/...
2022-11-01 12:40:08,549 - Module name:           nodes.facebook
2022-11-01 12:40:08,550 - Method name:           run_cli
2022-11-01 12:40:08,550 - Error message:         None
2022-11-01 12:40:08,551 - Start time:            2022-11-01 12:40:07.956726
2022-11-01 12:40:08,551 - End time:              2022-11-01 12:40:08.547358
2022-11-01 12:40:08,551 - Elapsed time:          0:00:00.590632
2022-11-01 12:40:08,556 - Variables:             (command)
2022-11-01 12:40:08,557 - Args:                  None
2022-11-01 12:40:08,557 - Kwargs:                None
2022-11-01 12:40:08,557 - Log path:              /app/.../run_cli_01Nov2022_124008.log
None # Should be a json string.
Traceback (most recent call last):
  File "/app/.../src/main.py", line 13, in <module>
    main()
  File "/app/.../src/main.py", line 9, in main
    FacebookNode.run_node()
  File "/app/.../src/nodes/facebook.py", line 95, in run_node
    dataframes.append(json_string_to_dataframe(data_string))
  File "/app/.../src/nodes/facebook.py", line 68, in json_string_to_dataframe
    data = json.loads(data_string)['data'][0]
  File "/usr/local/lib/python3.10/json/__init__.py", line 339, in loads
    raise TypeError(f'the JSON object must be str, bytes or bytearray, '
TypeError: the JSON object must be str, bytes or bytearray, not NoneType
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

No branches or pull requests

1 participant