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

fix(all): multiple warnings fix #2318

Open
wants to merge 18 commits into
base: dev
Choose a base branch
from

Conversation

TheoPascoli
Copy link
Contributor

@TheoPascoli TheoPascoli commented Jan 27, 2025

Fix multiple warnings and some stuff

@TheoPascoli TheoPascoli marked this pull request as draft January 27, 2025 15:32
@TheoPascoli TheoPascoli force-pushed the fix/remove-some-deprecated-methods branch from 8ecc6b5 to d43d9f9 Compare January 27, 2025 16:07
@TheoPascoli TheoPascoli force-pushed the fix/remove-some-deprecated-methods branch from d43d9f9 to d3c01ea Compare January 28, 2025 10:12
@TheoPascoli TheoPascoli changed the title fix: multiple warnings fix fix(all): multiple warnings fix Jan 28, 2025
@pull-request-size pull-request-size bot added size/L and removed size/M labels Jan 30, 2025
@TheoPascoli TheoPascoli marked this pull request as ready for review January 30, 2025 18:26
permissions=PermissionInfo(owner=owner.impersonator)
if owner
else PermissionInfo(public_mode=PublicMode.READ),
permissions=(
Copy link
Contributor

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

Copy link
Contributor

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

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[
Copy link
Contributor

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)
Copy link
Contributor

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}
Copy link
Contributor

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"])
Copy link
Contributor

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

Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants