Skip to content

Commit

Permalink
Hot Fix for Fuzzy Join (#939)
Browse files Browse the repository at this point in the history
This is a hot fix for Fuzzy Join test cases. For long term, the current
use case that fuzzy joins on id column does not make sense. We need a
better example.


👋 Thanks for submitting a Pull Request to EvaDB!

🙌 We want to make contributing to EvaDB as easy and transparent as
possible. Here are a few tips to get you started:

- 🔍 Search existing EvaDB
[PRs](https://github.com/georgia-tech-db/eva/pulls) to see if a similar
PR already exists.
- 🔗 Link this PR to a EvaDB
[issue](https://github.com/georgia-tech-db/eva/issues) to help us
understand what bug fix or feature is being implemented.
- 📈 Provide before and after profiling results to help us quantify the
improvement your PR provides (if applicable).

👉 Please see our ✅ [Contributing
Guide](https://evadb.readthedocs.io/en/stable/source/contribute/index.html)
for more details.
  • Loading branch information
xzdandy authored Aug 19, 2023
1 parent 045db67 commit 503d197
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion evadb/udfs/ndarray/fuzzy_join.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,7 @@ def forward(self, df: pd.DataFrame) -> pd.DataFrame:
ret (pd.DataFrame): The cropped frame.
"""
ret = pd.DataFrame()
ret["distance"] = df.apply(lambda row: fuzz.ratio(row[0], row[1]), axis=1)
ret["distance"] = df.apply(
lambda row: fuzz.ratio(str(row[0]), str(row[1])), axis=1
)
return ret
1 change: 1 addition & 0 deletions test/integration_tests/test_fuzzy_join.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def tearDown(self):
def test_fuzzyjoin(self):
execute_query_fetch_all(self.evadb, fuzzy_udf_query)

# TODO this test does not make sense. Need to improve
fuzzy_join_query = """SELECT * FROM MyVideo a JOIN MyVideoCSV b
ON FuzzDistance(a.id, b.id) = 100;"""

Expand Down

0 comments on commit 503d197

Please sign in to comment.