-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: Added warning messages when working with large points in local mode * chore: Added deprecation message * chore: Add default to idx * Fix: Updated local mode user warning for large volume of points * chore: Added cloud * chore: Updated async client * improve: Improved how we handle warning messages * chore: Changed warning stack level refactor: Refactored user warnings in local mode when large upload * fix: Fix ci * refactor: update warning messages --------- Co-authored-by: George Panchuk <[email protected]>
- Loading branch information
1 parent
ebc358c
commit 88543cb
Showing
7 changed files
with
67 additions
and
31 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import warnings | ||
from typing import Optional | ||
|
||
SEEN_MESSAGES = set() | ||
|
||
|
||
def show_warning(message: str, category: type[Warning] = UserWarning) -> None: | ||
warnings.warn(message, category, stacklevel=4) | ||
|
||
|
||
def show_warning_once( | ||
message: str, category: type[Warning] = UserWarning, idx: Optional[str] = None | ||
) -> None: | ||
""" | ||
Show a warning of the specified category only once per program run. | ||
""" | ||
key = idx if idx is not None else message | ||
|
||
if key not in SEEN_MESSAGES: | ||
SEEN_MESSAGES.add(key) | ||
show_warning(message, category) |
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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