@@ -1740,8 +1740,8 @@ def read_virtualfile(
1740
1740
1741
1741
def virtualfile_to_dataset (
1742
1742
self ,
1743
- output_type : Literal ["pandas" , "numpy" , "file" ],
1744
1743
vfname : str ,
1744
+ output_type : Literal ["pandas" , "numpy" , "file" ] = "pandas" ,
1745
1745
column_names : list [str ] | None = None ,
1746
1746
) -> pd .DataFrame | np .ndarray | None :
1747
1747
"""
@@ -1751,15 +1751,15 @@ def virtualfile_to_dataset(
1751
1751
1752
1752
Parameters
1753
1753
----------
1754
+ vfname
1755
+ The virtual file name that stores the result data. Required for ``"pandas"``
1756
+ and ``"numpy"`` output type.
1754
1757
output_type
1755
1758
Desired output type of the result data.
1756
1759
1757
1760
- ``"pandas"`` will return a :class:`pandas.DataFrame` object.
1758
1761
- ``"numpy"`` will return a :class:`numpy.ndarray` object.
1759
1762
- ``"file"`` means the result was saved to a file and will return ``None``.
1760
- vfname
1761
- The virtual file name that stores the result data. Required for ``"pandas"``
1762
- and ``"numpy"`` output type.
1763
1763
column_names
1764
1764
The column names for the :class:`pandas.DataFrame` output.
1765
1765
@@ -1795,7 +1795,7 @@ def virtualfile_to_dataset(
1795
1795
... ) as vouttbl:
1796
1796
... lib.call_module("read", f"{tmpfile.name} {vouttbl} -Td")
1797
1797
... result = lib.virtualfile_to_dataset(
1798
- ... output_type="file", vfname=vouttbl
1798
+ ... vfname=vouttbl, output_type="file"
1799
1799
... )
1800
1800
... assert result is None
1801
1801
... assert Path(outtmp.name).stat().st_size > 0
@@ -1805,7 +1805,7 @@ def virtualfile_to_dataset(
1805
1805
... with lib.virtualfile_out(kind="dataset") as vouttbl:
1806
1806
... lib.call_module("read", f"{tmpfile.name} {vouttbl} -Td")
1807
1807
... outnp = lib.virtualfile_to_dataset(
1808
- ... output_type="numpy", vfname=vouttbl
1808
+ ... vfname=vouttbl, output_type="numpy"
1809
1809
... )
1810
1810
... assert isinstance(outnp, np.ndarray)
1811
1811
...
@@ -1814,7 +1814,7 @@ def virtualfile_to_dataset(
1814
1814
... with lib.virtualfile_out(kind="dataset") as vouttbl:
1815
1815
... lib.call_module("read", f"{tmpfile.name} {vouttbl} -Td")
1816
1816
... outpd = lib.virtualfile_to_dataset(
1817
- ... output_type="pandas", vfname=vouttbl
1817
+ ... vfname=vouttbl, output_type="pandas"
1818
1818
... )
1819
1819
... assert isinstance(outpd, pd.DataFrame)
1820
1820
...
@@ -1823,8 +1823,8 @@ def virtualfile_to_dataset(
1823
1823
... with lib.virtualfile_out(kind="dataset") as vouttbl:
1824
1824
... lib.call_module("read", f"{tmpfile.name} {vouttbl} -Td")
1825
1825
... outpd2 = lib.virtualfile_to_dataset(
1826
- ... output_type="pandas",
1827
1826
... vfname=vouttbl,
1827
+ ... output_type="pandas",
1828
1828
... column_names=["col1", "col2", "col3", "coltext"],
1829
1829
... )
1830
1830
... assert isinstance(outpd2, pd.DataFrame)
0 commit comments