Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions flink-python/docs/reference/pyflink.dataframe/creation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ Example::
... {"id": 2, "name": "Bob"},
... ])
>>> users = pf.from_dict({"id": [1, 2], "name": ["Alice", "Bob"]})
>>> import pandas as pd
>>> import pyarrow as pa
>>> pandas_users = pf.from_pandas(
... pd.DataFrame({"id": [1, 2], "name": ["Alice", "Bob"]})
... )
>>> arrow_users = pf.from_arrow(
... pa.table({"id": [1, 2], "name": ["Alice", "Bob"]})
... )
>>> table_users = pf.from_table(users.to_table())
>>> identifiers = pf.range(5)

.. currentmodule:: pyflink.dataframe

Expand All @@ -38,3 +48,7 @@ Example::

from_records
from_dict
from_pandas
from_arrow
from_table
range
2 changes: 2 additions & 0 deletions flink-python/docs/reference/pyflink.dataframe/dataframe.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ Results
:toctree: api/

DataFrame.collect
DataFrame.to_table
DataFrame.to_pandas

Expressions
-----------
Expand Down
13 changes: 12 additions & 1 deletion flink-python/pyflink/dataframe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,14 @@
<Row(1, 'Alice', 31)>
"""

from pyflink.dataframe.convert import from_dict, from_records
from pyflink.dataframe.convert import (
from_arrow,
from_dict,
from_pandas,
from_records,
from_table,
range,
)
from pyflink.dataframe.context import (
get_or_create_table_environment,
get_table_environment,
Expand All @@ -52,8 +59,12 @@
"DataType",
"col",
"lit",
"from_arrow",
"from_dict",
"from_pandas",
"from_records",
"from_table",
"range",
"set_table_environment",
"get_table_environment",
"get_or_create_table_environment",
Expand Down
Loading