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 UP035 #2893

Merged
merged 8 commits into from
Nov 6, 2024
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
test
  • Loading branch information
andrewtruong committed Nov 5, 2024
commit fc20533c773c524f141f8488dcc245b369ef033e
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 2 additions & 4 deletions weave/trace_server/clickhouse_trace_server_batched.py
Original file line number Diff line number Diff line change
@@ -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,
@@ -1721,8 +1720,7 @@ def _query_stream(
"summary": summary,
},
)
for row in stream:
yield row
yield from stream

def _query(
self,
3 changes: 1 addition & 2 deletions weave/trace_server/sqlite_trace_server.py
Original file line number Diff line number Diff line change
@@ -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:
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
@@ -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]]
Loading