-
Notifications
You must be signed in to change notification settings - Fork 612
ref: Rename _timestamp to _end_timestamp
#6235
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
Changes from all commits
089147f
fee89f1
0177165
ea130a0
1e37225
ab6e51b
ea2436c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -244,7 +244,7 @@ class StreamedSpan: | |
| "_parent_sampled", | ||
| "_start_timestamp", | ||
| "_start_timestamp_monotonic_ns", | ||
| "_timestamp", | ||
| "_end_timestamp", | ||
| "_status", | ||
| "_scope", | ||
| "_previous_span_on_scope", | ||
|
|
@@ -291,7 +291,7 @@ def __init__( | |
| self._sample_rate = sample_rate | ||
|
|
||
| self._start_timestamp = datetime.now(timezone.utc) | ||
| self._timestamp: "Optional[datetime]" = None | ||
| self._end_timestamp: "Optional[datetime]" = None | ||
|
sentry-warden[bot] marked this conversation as resolved.
|
||
|
|
||
| # profiling depends on this value and requires that | ||
| # it is measured in nanoseconds | ||
|
|
@@ -327,7 +327,7 @@ def __enter__(self) -> "StreamedSpan": | |
| def __exit__( | ||
| self, ty: "Optional[Any]", value: "Optional[Any]", tb: "Optional[Any]" | ||
| ) -> None: | ||
| if self._timestamp is not None: | ||
| if self._end_timestamp is not None: | ||
| # This span is already finished, ignore | ||
| return | ||
|
|
||
|
|
@@ -361,7 +361,7 @@ def _start(self) -> None: | |
| self._previous_span_on_scope = old_span | ||
|
|
||
| def _end(self, end_timestamp: "Optional[Union[float, datetime]]" = None) -> None: | ||
| if self._timestamp is not None: | ||
| if self._end_timestamp is not None: | ||
| # This span is already finished, ignore. | ||
| return | ||
|
|
||
|
|
@@ -392,15 +392,15 @@ def _end(self, end_timestamp: "Optional[Union[float, datetime]]" = None) -> None | |
| pass | ||
|
|
||
| if isinstance(end_timestamp, datetime): | ||
| self._timestamp = end_timestamp | ||
| self._end_timestamp = end_timestamp | ||
| else: | ||
| logger.debug( | ||
| "[Tracing] Failed to set end_timestamp. Using current time instead." | ||
| ) | ||
|
|
||
| if self._timestamp is None: | ||
| if self._end_timestamp is None: | ||
| elapsed = nanosecond_time() - self._start_timestamp_monotonic_ns | ||
| self._timestamp = self._start_timestamp + timedelta( | ||
| self._end_timestamp = self._start_timestamp + timedelta( | ||
| microseconds=elapsed / 1000 | ||
| ) | ||
|
|
||
|
|
@@ -479,8 +479,8 @@ def start_timestamp(self) -> "Optional[datetime]": | |
| return self._start_timestamp | ||
|
|
||
| @property | ||
| def timestamp(self) -> "Optional[datetime]": | ||
| return self._timestamp | ||
| def end_timestamp(self) -> "Optional[datetime]": | ||
| return self._end_timestamp | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Renamed property breaks openai_agents integration at runtimeHigh Severity The Reviewed by Cursor Bugbot for commit ea2436c. Configure here.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this is true, how come our tests didn't catch this? 🙈
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah right, openai agents doesn't support span streaming yet, so that's ok. |
||
|
|
||
| def _is_segment(self) -> bool: | ||
| return self._segment is self | ||
|
|
@@ -699,7 +699,7 @@ def start_timestamp(self) -> "Optional[datetime]": | |
| return None | ||
|
|
||
| @property | ||
| def timestamp(self) -> "Optional[datetime]": | ||
| def end_timestamp(self) -> "Optional[datetime]": | ||
| return None | ||
|
|
||
|
|
||
|
|
||


Uh oh!
There was an error while loading. Please reload this page.