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

Invalid parameter name "from" in the Jira.tempo_4_timesheets_find_worklogs method #1273

Closed
anttipalsola opened this issue Nov 23, 2023 · 1 comment · Fixed by #1275
Closed

Comments

@anttipalsola
Copy link
Contributor

The parameter name from in the Jira.tempo_4_timesheets_find_worklogs method call (atlassian/jira.py:4118) causes a syntax error because from is a keyword in Python and thus cannot be used as parameter name:

>>> from atlassian import Jira
>>> j = Jira('https://localhost/')
>>> j.tempo_4_timesheets_find_worklogs(from='2023-01-01', to='2023-12-31')
  File "<stdin>", line 1
    j.tempo_4_timesheets_find_worklogs(from='2023-01-01', to='2023-12-31')
                                       ^^^^
SyntaxError: invalid syntax

The parameter needs to be renamed.

@anttipalsola
Copy link
Contributor Author

There is a workaround: you can pass the arguments as a dict prefixed with double asterisk:

j.tempo_4_timesheets_find_worklogs(**{'from': '2023-01-01', 'to': '2023-12-31'})

However, I don't think the workaround is a very intuitive nor Pythonic, so I prefer the parameter to be renamed.

anttipalsola added a commit to anttipalsola/atlassian-python-api that referenced this issue Nov 23, 2023
)

Rename the parameters of Jira.tempo_4_timesheets_find_worklogs as follows:
- from -> date_from
  - "from" is a keyword, so it cannot be used as a parameter name
  - "date_from" is also used in Jira.tempo_timesheets_get_worklogs
  - See atlassian-api#1273
- to -> date_to
  - renamed for consistency with date_from
gonchik pushed a commit that referenced this issue Nov 25, 2023
Rename the parameters of Jira.tempo_4_timesheets_find_worklogs as follows:
- from -> date_from
  - "from" is a keyword, so it cannot be used as a parameter name
  - "date_from" is also used in Jira.tempo_timesheets_get_worklogs
  - See #1273
- to -> date_to
  - renamed for consistency with date_from
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