Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
| | **Parallelism** | Fragment-parallel | Fragment-parallel | Partition-parallel | | ||
| | **Inherited columns** | N/A — adds to existing rows | Automatic from query | Independent output schema | | ||
| | **Registration** | `table.add_columns()` | `db.create_materialized_view(udtf=)` | `db.create_udtf_view()` | | ||
| | **Registration** | [`table.add_columns()`](https://lancedb.github.io/geneva/api/table/#geneva.table.Table.add_columns) | [`db.create_scalar_udtf_view()`](https://lancedb.github.io/geneva/api/connection/#geneva.db.Connection.create_scalar_udtf_view) | [`db.create_udtf_view()`](https://lancedb.github.io/geneva/api/connection/#geneva.db.Connection.create_udtf_view) | |
There was a problem hiding this comment.
The main thing that changed in this PR is that now you use create_scalar_udtf_view() instead of create_materialized_view(udtf=) to make a scalar UDTF.
I couldn't actually pull these out to their own snippets because they're in table cells, but I did add test_geneva_udfs_index just so a test will fail if we change one of these methods' names.
(I also added links just for convenience)
| ``` | ||
| <CodeGroup> | ||
| <CodeBlock filename="Python" language="python" icon="python"> | ||
| {PyScalarUdtfIterator} |
There was a problem hiding this comment.
this code is now in tests/py/test_geneva_scalar_udtfs.py; similarly to all the rest of this file
|
|
||
|
|
||
| # TODO: remove skip once geneva 0.12.0 is on PyPI (head node defaults changed to 4 CPU / 8Gi) | ||
| @pytest.mark.skip(reason="requires geneva>=0.12.0") |
There was a problem hiding this comment.
yay, while I was here I remembered to do this
| mock_conn = MagicMock() | ||
| import geneva | ||
| from unittest.mock import MagicMock, create_autospec | ||
| mock_conn = create_autospec(geneva.db.Connection, instance=True) |
There was a problem hiding this comment.
Ok, here's the important thing: MagicMocks let you call anything with any params... defeating the point of the test! But create_autospec will fail if the methods or params don't exist. So, updated this here.
| @@ -0,0 +1,311 @@ | |||
| # SPDX-License-Identifier: Apache-2.0 | |||
There was a problem hiding this comment.
No code has changed, this is just all the snippets + setup around them.
| ======= | ||
| "Pillow>=12.1.1", | ||
| >>>>>>> Stashed changes | ||
| "geneva>=0.12.0", |
There was a problem hiding this comment.
updated this and the uv.lock bc I guess it had previously gotten committed mid-rebase
The Scalar UDTF page has already gotten a little out of date. This PR pulls the code into tested snippets so that syntax errors don't happen, at least.