"from" keyword in data to validate raises an Syntax error
See original GitHub issueHello,
I’m running into a problem when validating the following data with pydantic:
{ "validity_dates": { "from": "2014-12-31", "to": "2015-12-31" } }
It’s the “from” key in the data that is problematic:
class ValidityDates(pydantic.BaseModel): from: str to: str
This code raises a SyntaxError: invalid syntax
. How can I map a supported class attribute like “from_” to the dict key “from” when:
- validating the data
- serialising the model
Thanks fo your help
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:13 (6 by maintainers)
Top Results From Across the Web
"from" keyword in data to validate raises an Syntax error #153
Hello, I'm running into a problem when validating the following data with pydantic: ... "from" keyword in data to validate raises an Syntax...
Read more >Invalid Syntax in Python: Common Reasons for SyntaxError
When the interpreter encounters invalid syntax in Python code, it will raise a SyntaxError exception and provide a traceback with some helpful information...
Read more >Errors and exceptions — Object-Oriented Programming in ...
Common Python syntax errors include: leaving out a keyword; putting a keyword in the wrong place; leaving out a symbol, such as a...
Read more >Python code works, but eclipse shows error - Syntax error ...
At the line print(r, end = '') , eclipse reports a syntax error - Syntax error while detecting tuple . However, the program...
Read more >SQL Error: "Syntax error at or near:" - Looker Community
Overview. This SQL error generally means that somewhere in the query, there is invalid syntax. Some common examples: Using a database-specific ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
No problem, surely
Would be simpler.