@@ 86-95 (lines=10) @@ | ||
83 | writer.close() |
|
84 | ||
85 | ||
86 | def upload_data(client, data, filename, metadata=None): |
|
87 | my_table = pyarrow.table(data) |
|
88 | if metadata is not None: |
|
89 | my_table.schema.with_metadata(metadata) |
|
90 | print('Table rows=', str(len(my_table))) |
|
91 | print("Uploading", data.head()) |
|
92 | writer, _ = client.do_put( |
|
93 | pyarrow.flight.FlightDescriptor.for_path(filename), my_table.schema) |
|
94 | writer.write_table(my_table) |
|
95 | writer.close() |
|
96 | ||
97 | ||
98 | def get_flight_by_path(path, client, connection_args={}): |
@@ 86-95 (lines=10) @@ | ||
83 | writer.close() |
|
84 | ||
85 | ||
86 | def upload_data(client, data, filename, metadata=None): |
|
87 | my_table = pyarrow.table(data) |
|
88 | if metadata is not None: |
|
89 | my_table.schema.with_metadata(metadata) |
|
90 | print('Table rows=', str(len(my_table))) |
|
91 | print("Uploading", data.head()) |
|
92 | writer, _ = client.do_put( |
|
93 | pyarrow.flight.FlightDescriptor.for_path(filename), my_table.schema) |
|
94 | writer.write_table(my_table) |
|
95 | writer.close() |
|
96 | ||
97 | ||
98 | def get_flight_by_path(path, client, connection_args={}): |