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

chore(weave): ruff: enable UP028 #2888

Merged
merged 3 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ select = [
"TID252", # https://docs.astral.sh/ruff/rules/relative-imports/#relative-imports-tid252
"UP006", # https://docs.astral.sh/ruff/rules/non-pep585-annotation/
"UP007", # https://docs.astral.sh/ruff/rules/non-pep604-annotation/
"UP028", # https://docs.astral.sh/ruff/rules/yield-in-for-loop/
]
ignore = [
# we use Google style
Expand Down
6 changes: 2 additions & 4 deletions weave/trace_server/clickhouse_trace_server_batched.py
Original file line number Diff line number Diff line change
Expand Up @@ -827,8 +827,7 @@ def table_query_stream(
limit=req.limit,
offset=req.offset,
)
for row in rows:
yield row
yield from rows

def _table_query_stream(
self,
Expand Down Expand Up @@ -1721,8 +1720,7 @@ def _query_stream(
"summary": summary,
},
)
for row in stream:
yield row
yield from stream

def _query(
self,
Expand Down
3 changes: 1 addition & 2 deletions weave/trace_server/sqlite_trace_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -1186,8 +1186,7 @@ def table_query_stream(
self, req: tsi.TableQueryReq
) -> Iterator[tsi.TableRowSchema]:
results = self.table_query(req)
for row in results.rows:
yield row
yield from results.rows


def get_type(val: Any) -> str:
Expand Down
3 changes: 1 addition & 2 deletions weave/trace_server_bindings/remote_http_trace_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,8 +446,7 @@ def table_query_stream(
) -> Iterator[tsi.TableRowSchema]:
# Need to manually iterate over this until the stram endpoint is built and shipped.
res = self.table_query(req)
for row in res.rows:
yield row
yield from res.rows

def table_query_stats(
self, req: Union[tsi.TableQueryStatsReq, dict[str, Any]]
Expand Down
Loading