-
Notifications
You must be signed in to change notification settings - Fork 52
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
Implement appendable tabular data #679
Conversation
How can we make the tiled/tiled/client/register.py Lines 296 to 326 in acfa2a2
This code typically operates with adapters that expect a single parameter Notice that in the code above, we construct an instance of the adapter = await anyio.to_thread.run_sync(adapter_factory, ensure_uri(item)) and then we ask return await create_node_or_drop_collision(
...,
data_sources=[
DataSource(
structure_family=adapter.structure_family,
mimetype=mimetype,
structure=dict_or_none(adapter.structure()),
parameters={},
management=Management.external,
assets=[
Asset(
data_uri=ensure_uri(item),
is_directory=is_directory,
parameter="data_uri",
)
],
)
],
) to if hasattr(adapter, "generate_data_sources"):
# Let the Adapter describe the DataSouce(s).
data_sources = adapter.generate_data_sources()
else:
# Back-compat: Assume one Asset passed as a
# parameter named 'data_uri'.
data_source = [
DataSource(
structure_family=adapter.structure_family,
mimetype=mimetype,
structure=dict_or_none(adapter.structure()),
parameters={},
management=Management.external,
assets=[
Asset(
data_uri=ensure_uri(item),
is_directory=is_directory,
parameter="data_uri",
)
],
)
],
return await create_node_or_drop_collision(
...,
data_sources=data_sources,
) Then, a new method [
DataSource(
structure_family=adapter.structure_family,
mimetype=mimetype,
structure=dict_or_none(adapter.structure()),
parameters={},
management=Management.external,
assets=[
Asset(
data_uri=ensure_uri(item),
is_directory=is_directory,
parameter="data_uris", # <-- PLURAL!
num=0 # <-- denoting that the Adapter expects a list, and this is the first element
)
],
)
] |
Naive question: Why does Does the strategy include writing appended rows to a new file? Or is this "chunking" of columns? or...? |
This is chunking of partitions:
When Tiled wrties CSVs, it adopts this strategy for scability. But when CSV registers CSVs may encounter partitioned or non-partitioned files and should be able to manage both, potentially. Appending extends a specific partition, i.e. adds rows for an existing file. New partitions may also be created as needed. |
fc97f6e
to
a2c8580
Compare
Rebased on #686. The second force-push was to retain @skarakuzu's authorship is retained in the commit history. |
e46aca8
to
2ff7697
Compare
62eeab5
to
8ea41e7
Compare
* append method in the client side * Support writing tables as CSV. * implemented appending to files * fix bug in a test * Add ability to parse file structure in .csvAdapter 📂 * fix some more bugs * fix some more tests * cleaned the files * fixed black and flake errors * implemented append method in the client side * implemented append method in the client side * added an integration test for the new append method * Added a CHANGELOG file * changed the append test to parametrized * fixed failing string test * fix append strng test * changed the type check in assert_frame_equal * Elaborate on changelog. --------- Co-authored-by: Seher Karakuzu <[email protected]> Co-authored-by: Dan Allan <[email protected]> Co-authored-by: Seher Karakuzu <[email protected]> Co-authored-by: kari Barry <[email protected]>
work in progress implementing append data to file