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 crashing syncing thread when logging big integers #1336

Merged
merged 3 commits into from
May 8, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Review fixes
  • Loading branch information
aniezurawski committed May 8, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 79bc17a0101fe093f43a2713e9e7e460753884c1
9 changes: 3 additions & 6 deletions src/neptune/attributes/atoms/integer.py
Original file line number Diff line number Diff line change
@@ -15,21 +15,18 @@
#
__all__ = ["Integer"]

import logging
import typing

from neptune.attributes.atoms.copiable_atom import CopiableAtom
from neptune.internal.container_type import ContainerType
from neptune.internal.operation import AssignInt
from neptune.internal.utils.logger import logger
from neptune.types.atoms.integer import Integer as IntegerVal

if typing.TYPE_CHECKING:
from neptune.internal.backends.neptune_backend import NeptuneBackend


_logger = logging.getLogger(__name__)


class Integer(CopiableAtom):

MAX_32_BIT_INT = 2147483647
@@ -53,8 +50,8 @@ def assign(self, value: typing.Union[IntegerVal, float, int], *, wait: bool = Fa
if not isinstance(value, IntegerVal):
value = IntegerVal(value)

if value.value > Integer.MAX_32_BIT_INT or value.value < Integer.MIN_32_BIT_INT:
_logger.warning(
if Integer.MIN_32_BIT_INT < value.value < Integer.MAX_32_BIT_INT:
logger.warning(
"WARNING: The value you're trying to log is outside the range of 32-bit integers "
"(%s to %s) and will be skipped. "
"We'll support 64-bit integers in the future. "