Open
Conversation
interlark
reviewed
Feb 9, 2024
Owner
interlark
left a comment
There was a problem hiding this comment.
Thanks for your contribution, configuration's validation errors will be fixed in v1.2.0 anyway.
| Schedule as a string. | ||
| """ | ||
| days_names = [x.name for x in self.__fields__.values() if x.type_ == ScheduleDay] | ||
| days_names = [x.name for x in self.__fields__.values() if type(x) == ScheduleDay] |
Owner
There was a problem hiding this comment.
I am not quite sure what version of Pydantic you use, but type(x) should always return pydantic.fields.ModelField, that's why there is special attribute type_ for the fields.
| def setup_config(model: BaseModel) -> None: | ||
| """Recursively setup config.""" | ||
| self.Config.validate_assignment = True | ||
| # self.Config.validate_assignment = True |
Owner
There was a problem hiding this comment.
Assignments validation is important for any settings changes, why have you turned it off?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Using script for as cli app raise multiuple errors, starting from wrong field in model and in writing data in csv file, this request make it executable, example of request: python parser-2gis.py -i https://2gis.kz/almaty/search/%D0%9F%D0%BE%D0%B5%D1%81%D1%82%D1%8C -f csv -o C:\Users\Папин\Desktop\Kanat\commits
get default path to Config and remove wrong lines