Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
f87483b
Set up lint workflow
peytondmurray Oct 2, 2024
9899e6b
Apply fixes for linting issues
peytondmurray Oct 2, 2024
ae9d64e
Merge remote-tracking branch 'upstream/master' into 29-lint-fixes
smokestacklightnin Aug 15, 2025
64d2031
Add `noqa` for Ruff rule E721
smokestacklightnin Aug 15, 2025
e72a36a
Apply fixes for Ruff rule UP008
smokestacklightnin Aug 15, 2025
27a6b79
Make compliant with Ruff rule UP032
smokestacklightnin Aug 15, 2025
cb66c6c
Make compliant with Ruff rule B007
smokestacklightnin Aug 15, 2025
8a236ca
Make compliant with Ruff rule SIM117
smokestacklightnin Aug 15, 2025
de27b08
Make compliant with Ruff rule SIM108
smokestacklightnin Aug 15, 2025
1488516
Make compliant with Ruff rule SIM105
smokestacklightnin Aug 15, 2025
76028b0
Make compliant with Ruff rule SIM110
smokestacklightnin Aug 15, 2025
390efe0
Make compliant with Ruff rule SIM101
smokestacklightnin Aug 15, 2025
57a5b2b
Make compliant with Ruff rule SIM118
smokestacklightnin Aug 15, 2025
d58da30
Make compliant with Ruff rule D200
smokestacklightnin Aug 15, 2025
e5d6359
Make compliant with Ruff rule RET505
smokestacklightnin Aug 15, 2025
399ec56
Make compliant with Ruff rule RET504
smokestacklightnin Aug 15, 2025
535fee2
Make compliant with Ruff rule PD013
smokestacklightnin Aug 15, 2025
721c5a0
Merge remote-tracking branch 'origin/29-lint-fixes' into 29-lint-work…
smokestacklightnin Aug 15, 2025
42cce74
Remove unnecessary Ruff rule ignores
smokestacklightnin Aug 15, 2025
09197ab
Add compatibility with Python 3.9
smokestacklightnin Aug 15, 2025
ed83546
Remove bytecode
smokestacklightnin Aug 15, 2025
b737804
Apply Ruff formatting
smokestacklightnin Aug 15, 2025
11b4700
Merge branch '29-lint-fixes' into 29-lint-workflow
smokestacklightnin Aug 15, 2025
78a9233
Add Ruff format to pre-commit config
smokestacklightnin Aug 15, 2025
91ac0e8
Run pre-commit
smokestacklightnin Aug 15, 2025
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
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.5.0
6.5.0
14 changes: 14 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: pre-commit

on:
pull_request:
push:
branches: [master]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: pre-commit/action@v3.0.1
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist/
bazel-*
39 changes: 39 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# pre-commit is a tool to perform a predefined set of tasks manually and/or
# automatically before git commits are made.
#
# Config reference: https://pre-commit.com/#pre-commit-configyaml---top-level
#
# Common tasks
#
# - Register git hooks: pre-commit install --install-hooks
# - Run on all files: pre-commit run --all-files
#
# These pre-commit hooks are run as CI.
#
# NOTE: if it can be avoided, add configs/args in pyproject.toml or below instead of creating a new `.config.file`.
# https://pre-commit.ci/#configuration
ci:
autoupdate_schedule: monthly
autofix_commit_msg: |
[pre-commit.ci] Apply automatic pre-commit fixes

repos:
# general
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: end-of-file-fixer
exclude: '\.svg$'
- id: trailing-whitespace
exclude: '\.svg$'
- id: check-json
- id: check-yaml
args: [--allow-multiple-documents, --unsafe]
- id: check-toml

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.6
hooks:
- id: ruff
args: ["--fix"]
- id: ruff-format
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -198,4 +198,4 @@
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
1 change: 0 additions & 1 deletion g3doc/api_docs/python/expression_impl.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,3 @@ s2t.expression_impl.apply_schema
[`size`](./expression_impl/size.md) module: Functions for creating new size or has expression.

[`slice_expression`](./expression_impl/slice_expression.md) module: Implementation of slice.

2 changes: 1 addition & 1 deletion g3doc/api_docs/python/expression_impl/all_symbols.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@
* <a href="../expression_impl/size/size_anonymous.md"><code>expression_impl.size.size_anonymous</code></a>
* <a href="../expression_impl/slice_expression.md"><code>expression_impl.slice_expression</code></a>
* <a href="../expression_impl/slice_expression/IndexValue.md"><code>expression_impl.slice_expression.IndexValue</code></a>
* <a href="../expression_impl/slice_expression/slice_expression.md"><code>expression_impl.slice_expression.slice_expression</code></a>
* <a href="../expression_impl/slice_expression/slice_expression.md"><code>expression_impl.slice_expression.slice_expression</code></a>
1 change: 0 additions & 1 deletion g3doc/api_docs/python/expression_impl/apply_schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,3 @@ my_new_schema has semantically identical information on the fields as my_schema.
## Functions

[`apply_schema(...)`](../expression_impl/apply_schema/apply_schema.md)

1 change: 0 additions & 1 deletion g3doc/api_docs/python/expression_impl/broadcast.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,3 @@ session: {
[`broadcast(...)`](../expression_impl/broadcast/broadcast.md)

[`broadcast_anonymous(...)`](../expression_impl/broadcast/broadcast_anonymous.md)

1 change: 0 additions & 1 deletion g3doc/api_docs/python/expression_impl/depth_limit.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,3 @@ You get:
## Functions

[`limit_depth(...)`](../expression_impl/depth_limit/limit_depth.md): Limit the depth to nodes k steps from expr.

1 change: 0 additions & 1 deletion g3doc/api_docs/python/expression_impl/filter_expression.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,3 @@ root_2 = filter_expression.filter_by_child(
[`filter_by_child(...)`](../expression_impl/filter_expression/filter_by_child.md): Filter an expression by an optional boolean child field.

[`filter_by_sibling(...)`](../expression_impl/filter_expression/filter_by_sibling.md): Filter an expression by its sibling.

Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,3 @@ The new root expression.
</tr>

</table>

Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,3 @@ a new root.
</tr>

</table>

1 change: 0 additions & 1 deletion g3doc/api_docs/python/expression_impl/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,3 @@ take little memory or CPU.
[`get_index_from_end(...)`](../expression_impl/index/get_index_from_end.md): Gets the number of steps from the end of the array.

[`get_positional_index(...)`](../expression_impl/index/get_positional_index.md): Gets the positional index.

Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,3 @@ The new expression and the new path as a pair.
</tr>

</table>

Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,3 @@ The new expression and the new path as a pair.
</tr>

</table>

1 change: 0 additions & 1 deletion g3doc/api_docs/python/expression_impl/map_prensor.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,3 @@ session: {
[`map_ragged_tensor(...)`](../expression_impl/map_prensor/map_ragged_tensor.md): Map a ragged tensor.

[`map_sparse_tensor(...)`](../expression_impl/map_prensor/map_sparse_tensor.md): Maps a sparse tensor.

Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,3 @@ root_path.get_child(new_field_name), with the result of the operation.
</tr>

</table>

Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,3 @@ root_path.get_child(new_field_name), with the result of the operation.
</tr>

</table>

Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,3 @@ foo bar foo2 bar2
[`create_schema(...)`](../expression_impl/map_prensor_to_prensor/create_schema.md): Create a schema recursively.

[`map_prensor_to_prensor(...)`](../expression_impl/map_prensor_to_prensor/map_prensor_to_prensor.md): Maps an expression to a prensor, and merges that prensor.

Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,3 @@ child schemas.
<pre class="devsite-click-to-copy prettyprint lang-py tfo-signature-link">
<code>known_field_names() -> FrozenSet[path.Step]
</code></pre>






Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,3 @@ a new Schema represented by the inputs.
</tr>

</table>

Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,3 @@ A new expression where the prensor is merged.
</tr>

</table>

1 change: 0 additions & 1 deletion g3doc/api_docs/python/expression_impl/map_values.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,3 @@ Note that the operations are on 1-D tensors (as opposed to scalars).
[`map_values(...)`](../expression_impl/map_values/map_values.md): Map field into a new sibling.

[`map_values_anonymous(...)`](../expression_impl/map_values/map_values_anonymous.md): Map field into a new sibling.

Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,3 @@ The new expression and the new path as a pair.
</tr>

</table>

Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,3 @@ The new expression.
</tr>

</table>

Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,3 @@ The new expression and the new path as a pair.
</tr>

</table>

1 change: 0 additions & 1 deletion g3doc/api_docs/python/expression_impl/parquet.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,3 @@ Apache Parquet Dataset.
[`calculate_parquet_values(...)`](../expression_impl/parquet/calculate_parquet_values.md): Calculates expressions and returns a parquet dataset.

[`create_expression_from_parquet_file(...)`](../expression_impl/parquet/create_expression_from_parquet_file.md): Creates a placeholder expression from a parquet file.

Original file line number Diff line number Diff line change
Expand Up @@ -3447,9 +3447,3 @@ execution is not enabled.
<pre class="devsite-click-to-copy prettyprint lang-py tfo-signature-link">
<code>__nonzero__()
</code></pre>






Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,3 @@ A parquet dataset.
</tr>

</table>

Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,3 @@ graph.
</tr>

</table>

1 change: 0 additions & 1 deletion g3doc/api_docs/python/expression_impl/placeholder.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,3 @@ result = calculate.calculate_values([new_exp],
[`create_expression_from_schema(...)`](../expression_impl/placeholder/create_expression_from_schema.md): Creates a placeholder expression from a parquet schema.

[`get_placeholder_paths_from_graph(...)`](../expression_impl/placeholder/get_placeholder_paths_from_graph.md): Gets all placeholder paths from an expression graph.

Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,3 @@ graph.
</tr>

</table>

Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,3 @@ a list of paths of placeholder expressions
</tr>

</table>

1 change: 0 additions & 1 deletion g3doc/api_docs/python/expression_impl/project.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,3 @@ prensor_result now has two paths, "foo.bar" and "x.y".
## Functions

[`project(...)`](../expression_impl/project/project.md): select a subtree.

1 change: 0 additions & 1 deletion g3doc/api_docs/python/expression_impl/project/project.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,3 @@ A projected expression.
</tr>

</table>

1 change: 0 additions & 1 deletion g3doc/api_docs/python/expression_impl/promote.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,3 @@ session: {
[`promote(...)`](../expression_impl/promote/promote.md): Promote a path to be a child of its grandparent, and give it a name.

[`promote_anonymous(...)`](../expression_impl/promote/promote_anonymous.md): Promote a path to be a new anonymous child of its grandparent.

Original file line number Diff line number Diff line change
Expand Up @@ -1037,8 +1037,3 @@ Boolean of equality of two expressions
</tr>

</table>





Original file line number Diff line number Diff line change
Expand Up @@ -1034,8 +1034,3 @@ Boolean of equality of two expressions
</tr>

</table>





Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,3 @@ session: {
[`promote_and_broadcast(...)`](../expression_impl/promote_and_broadcast/promote_and_broadcast.md): Promote and broadcast a set of paths to a particular location.

[`promote_and_broadcast_anonymous(...)`](../expression_impl/promote_and_broadcast/promote_and_broadcast_anonymous.md): Promotes then broadcasts the origin until its parent is new_parent.

Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,3 @@ until they are children of dest_path_parent.
</tr>

</table>

1 change: 0 additions & 1 deletion g3doc/api_docs/python/expression_impl/proto.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,3 @@ for its children.
[`ProtoExpression`](../expression_impl/proto/ProtoExpression.md)

[`TransformFn`](../expression_impl/proto/TransformFn.md)

5 changes: 0 additions & 5 deletions g3doc/api_docs/python/expression_impl/proto/DescriptorPool.md
Original file line number Diff line number Diff line change
Expand Up @@ -806,8 +806,3 @@ if the service cannot be found in the pool.
</td>
</tr>
</table>





Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,3 @@ A ProtocolMessage
</td>
</tr>
</table>



Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,3 @@ An expression.
</tr>

</table>

Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,3 @@ An expression.
</tr>

</table>

Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,3 @@ if the source path is not a proto message field.
</td>
</tr>
</table>

1 change: 0 additions & 1 deletion g3doc/api_docs/python/expression_impl/reroot.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,3 @@ original proto.
[`create_proto_index_field(...)`](../expression_impl/reroot/create_proto_index_field.md)

[`reroot(...)`](../expression_impl/reroot/reroot.md): Reroot to a new path, maintaining a input proto index.

1 change: 0 additions & 1 deletion g3doc/api_docs/python/expression_impl/reroot/reroot.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,3 @@ the new root.
</tr>

</table>

1 change: 0 additions & 1 deletion g3doc/api_docs/python/expression_impl/size.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,3 @@ is always present, and is true if there are one or more bar in foo.
[`size(...)`](../expression_impl/size/size.md): Get the size of a field as a new sibling field.

[`size_anonymous(...)`](../expression_impl/size/size_anonymous.md): Calculate the size of a field, and store it as an anonymous sibling.

5 changes: 0 additions & 5 deletions g3doc/api_docs/python/expression_impl/size/SizeExpression.md
Original file line number Diff line number Diff line change
Expand Up @@ -1036,8 +1036,3 @@ Boolean of equality of two expressions
</tr>

</table>





1 change: 0 additions & 1 deletion g3doc/api_docs/python/expression_impl/size/has.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,3 @@ The new expression.
</tr>

</table>

1 change: 0 additions & 1 deletion g3doc/api_docs/python/expression_impl/size/size.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,3 @@ The new expression.
</tr>

</table>

Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,3 @@ The new expression and the new field as a pair.
</tr>

</table>

1 change: 0 additions & 1 deletion g3doc/api_docs/python/expression_impl/slice_expression.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,3 @@ result_2 = [{
## Type Aliases

[`IndexValue`](../expression_impl/slice_expression/IndexValue.md)

Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,3 @@ A new root expression.
</tr>

</table>

1 change: 0 additions & 1 deletion g3doc/api_docs/python/s2t.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,3 @@ Import core names for struct2tensor.
[`NodeTensor`](./s2t/NodeTensor.md)

[`Step`](./s2t/Step.md)

5 changes: 0 additions & 5 deletions g3doc/api_docs/python/s2t/ChildNodeTensor.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,3 @@ A tensor of positional indices.
</tr>

</table>





5 changes: 0 additions & 5 deletions g3doc/api_docs/python/s2t/Expression.md
Original file line number Diff line number Diff line change
Expand Up @@ -1095,8 +1095,3 @@ Boolean of equality of two expressions
</tr>

</table>





5 changes: 0 additions & 5 deletions g3doc/api_docs/python/s2t/LeafNodeTensor.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,3 @@ A tensor of positional indices.
</tr>

</table>





4 changes: 0 additions & 4 deletions g3doc/api_docs/python/s2t/Path.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,3 @@ Return self<value.
</code></pre>

Return self!=value.




Loading
Loading