-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: fix the remaining datafusion test failures (#5)
While this fixes the datafusion tests locally, there is a packaging issue that causes CI to fail. The tests have been left in an xfail state so the change can be available for development while the packaging issue is researched.
- Loading branch information
1 parent
961ce89
commit a490133
Showing
10 changed files
with
81 additions
and
52 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
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 |
---|---|---|
|
@@ -5,7 +5,7 @@ authors = [{name = "Substrait contributors", email = "[email protected] | |
license = {text = "Apache-2.0"} | ||
readme = "README.md" | ||
requires-python = ">=3.8.1" | ||
dependencies = ["protobuf >= 3.20", "datafusion"] | ||
dependencies = ["protobuf >= 3.20", "datafusion >= 36.0.0", "pyarrow >= 15.0.2"] | ||
dynamic = ["version"] | ||
|
||
[tool.setuptools_scm] | ||
|
@@ -29,12 +29,12 @@ respect-gitignore = true | |
target-version = "py310" | ||
# never autoformat upstream or generated code | ||
exclude = ["third_party/", "src/spark/connect"] | ||
# do not autofix the following (will still get flagged in lint) | ||
|
||
[lint] | ||
unfixable = [ | ||
"F401", # unused imports | ||
"T201", # print statements | ||
"E712", # truth comparison checks | ||
] | ||
|
||
[tool.pylint.MASTER] | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
"""A library to search Substrait plan for local files.""" | ||
from substrait.gen.proto import plan_pb2 | ||
|
||
from gateway.converter.substrait_plan_visitor import SubstraitPlanVisitor | ||
|
||
|
||
# pylint: disable=no-member,fixme | ||
class RenameFunctions(SubstraitPlanVisitor): | ||
"""Renames Substrait functions to match what Datafusion expects.""" | ||
|
||
def visit_plan(self, plan: plan_pb2.Plan) -> None: | ||
"""Modifies the provided plan so that functions are Datafusion compatible.""" | ||
super().visit_plan(plan) | ||
|
||
for extension in plan.extensions: | ||
if extension.WhichOneof('mapping_type') != 'extension_function': | ||
continue | ||
|
||
# TODO -- Take the URI references into account. | ||
if extension.extension_function.name == 'substring': | ||
extension.extension_function.name = 'substr' |
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