-
Notifications
You must be signed in to change notification settings - Fork 6
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
fix(all): multiple warnings fix #2318
base: dev
Are you sure you want to change the base?
Conversation
8ecc6b5
to
d43d9f9
Compare
d43d9f9
to
d3c01ea
Compare
…om/AntaresSimulatorTeam/AntaREST into fix/remove-some-deprecated-methods
…ated-methods # Conflicts: # antarest/tools/lib.py
permissions=PermissionInfo(owner=owner.impersonator) | ||
if owner | ||
else PermissionInfo(public_mode=PublicMode.READ), | ||
permissions=( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: Why did you change this I don't understand
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I think it's your black version
antarest/service_creator.py
Outdated
def create_core_services( | ||
app_ctxt: t.Optional[AppBuildContext], config: Config | ||
) -> t.Tuple[ICache, IEventBus, ITaskService, FileTransferManager, LoginService, MatrixService, StudyService,]: | ||
def create_core_services(app_ctxt: t.Optional[AppBuildContext], config: Config) -> t.Tuple[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question here. Perhaps removing the ,
at the end of the list will put it back in one line
@@ -154,8 +154,8 @@ class LinkBaseDTO(AntaresBaseModel): | |||
colorg: int = Field(default=DEFAULT_COLOR, ge=0, le=255) | |||
link_width: float = 1 | |||
link_style: LinkStyle = LinkStyle.PLAIN | |||
filter_synthesis: t.Optional[comma_separated_enum_list] = FILTER_VALUES | |||
filter_year_by_year: t.Optional[comma_separated_enum_list] = FILTER_VALUES | |||
filter_synthesis: t.Optional[comma_separated_enum_list] = field(default_factory=lambda: FILTER_VALUES) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it work to use a dataclass field inside a Pydantic class ?
return [] | ||
|
||
filter_accepted_values = [e for e in enum_cls] | ||
valid_values = {str(e.value) for e in enum_cls} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think you need to do str() as e.value is already one
|
||
res_json = res.json() | ||
assert res_json["exception"] == "LinkValidationError" | ||
match = re.search(r"Allowed values are: (.*)\.", res_json["description"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test seems a bit complex to me. If you can just check the res_json["description"] in an easier way I won't mind
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, however, the values "daily, hourly, etc" comes in random order at each test, I can not do a simple equal
Fix multiple warnings and some stuff