Skip to content

Commit

Permalink
ADDED table_mode to frame(s)_to_hyper construction and parameter desc…
Browse files Browse the repository at this point in the history
…riptionse in api.rst (#175)
  • Loading branch information
ladoramkershner committed Dec 9, 2022
1 parent 1129aff commit 3b9731f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions doc/source/api.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
API Reference
=============

.. py:function:: frame_to_hyper(df: pd.DataFrame, database: Union[str, pathlib.Path], *, table: Union[str, tableauhyperapi.Name, tableauhyperapi.TableName], hyper_process: Optional[HyperProcess]) -> None:
.. py:function:: frame_to_hyper(df: pd.DataFrame, database: Union[str, pathlib.Path], *, table: Union[str, tableauhyperapi.Name, tableauhyperapi.TableName], table_mode: str = "w", hyper_process: Optional[HyperProcess]) -> None:
Convert a DataFrame to a .hyper extract.

:param df: Data to be written out.
:param database: Name / location of the Hyper file to write to.
:param table: Table to write to. Must be supplied as a keyword argument.
:param table_mode: The mode to open the table with. Default is "w" for write, which truncates the file before writing. Another option is "a", which will append data to the file if it already contains information.
:param hyper_process: A `HyperProcess` in case you want to spawn it by yourself. Optional. Must be supplied as a keyword argument.
:param use_parquet: Use a temporary parquet file to write into the Hyper database, which typically will yield better performance. Boolean, default False

Expand All @@ -23,12 +24,13 @@ API Reference
:rtype: pd.DataFrame


.. py:function:: frames_to_hyper(dict_of_frames: Dict[Union[str, tableauhyperapi.Name, tableauhyperapi.TableName], pd.DataFrame], database: Union[str, pathlib.Path], *, hyper_process: Optional[HyperProcess]) -> None:
.. py:function:: frames_to_hyper(dict_of_frames: Dict[Union[str, tableauhyperapi.Name, tableauhyperapi.TableName], pd.DataFrame], database: Union[str, pathlib.Path], table_mode: str = "w", *, hyper_process: Optional[HyperProcess]) -> None:
Writes multiple DataFrames to a .hyper extract.

:param dict_of_frames: A dictionary whose keys are valid table identifiers and values are dataframes
:param database: Name / location of the Hyper file to write to.
:param table_mode: The mode to open the table with. Default is "w" for write, which truncates the file before writing. Another option is "a", which will append data to the file if it already contains information.
:param hyper_process: A `HyperProcess` in case you want to spawn it by yourself. Optional. Must be supplied as a keyword argument.
:param use_parquet: Use a temporary parquet file to write into the Hyper database, which typically will yield better performance. Boolean, default False

Expand Down

0 comments on commit 3b9731f

Please sign in to comment.