Skip to content

Opt/saving files#198

Open
ipmach wants to merge 6 commits into
developmentfrom
opt/saving_files
Open

Opt/saving files#198
ipmach wants to merge 6 commits into
developmentfrom
opt/saving_files

Conversation

@ipmach

@ipmach ipmach commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Description

Optimization of To class. Before saving parsed logs or alerts could slow because the class was loading and saving to memory multiple times. Now it allows to only do it once or a smaller amount of times.

Checklist

  • This Pull-Request goes to the development branch.
  • I have successfully run prek locally.
  • I have added tests to cover my changes.
  • I have linked the issue-id to the task-description.
  • I have performed a self-review of my own code.

Base automatically changed from development to main July 6, 2026 11:04
Copilot AI requested a review from viktorbeck98 July 6, 2026 11:06
@staticmethod
@overload
def binary_file(out_: BaseSchema | bytes | None, out_path: str) -> bytes | None:
...
@staticmethod
@overload
def binary_file(out_: list[BaseSchema] | list[bytes], out_path: str) -> list[bytes]:
...
@overload
@staticmethod
def json(out_: BaseSchema | None, out_path: str) -> BaseSchema | None:
...
@overload
@staticmethod
def json(out_: list[BaseSchema], out_path: str) -> list[BaseSchema]:
...
@staticmethod
@overload
def yaml(out_: BaseSchema | None, out_path: str) -> BaseSchema | None:
...
@staticmethod
@overload
def yaml(out_: list[BaseSchema], out_path: str) -> list[BaseSchema] | None:
...
return func(*args, **kwargs)
else:
aux = func(*args, **kwargs)
return aux[0] if aux is not None else None

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't that a bit fragile?

@viktorbeck98 viktorbeck98 changed the base branch from main to development July 6, 2026 11:54
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 this pull request may close these issues.

2 participants