Skip to content

Commit

Permalink
Merge pull request #107 from treasure-data/doc-update
Browse files Browse the repository at this point in the history
Update README and documentation
  • Loading branch information
takuti authored Feb 15, 2021
2 parents c8faf03 + 3035c5e commit 533457a
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 26 deletions.
11 changes: 6 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pytd
**pytd** provides user-friendly interfaces to Treasure Data’s `REST
APIs <https://github.com/treasure-data/td-client-python>`__, `Presto
query
engine <https://tddocs.atlassian.net/wiki/spaces/PD/pages/1083607/Presto+Query+Engine+Introduction>`__,
engine <https://docs.treasuredata.com/display/public/PD/About+Presto+Distributed+Query+Engine>`__,
and `Plazma primary
storage <https://www.slideshare.net/treasure-data/td-techplazma>`__.

Expand All @@ -29,9 +29,9 @@ Usage
Colaboratory <https://colab.research.google.com/drive/1ps_ChU-H2FvkeNlj1e1fcOebCt4ryN11>`__

Set your `API
key <https://tddocs.atlassian.net/wiki/spaces/PD/pages/1081428/Getting+Your+API+Keys>`__
key <https://docs.treasuredata.com/display/public/PD/Getting+Your+API+Keys>`__
and
`endpoint <https://tddocs.atlassian.net/wiki/spaces/PD/pages/1085143/Sites+and+Endpoints>`__
`endpoint <https://docs.treasuredata.com/display/public/PD/Sites+and+Endpoints>`__
to the environment variables, ``TD_API_KEY`` and ``TD_API_SERVER``,
respectively, and create a client instance:

Expand Down Expand Up @@ -123,7 +123,8 @@ Since td-spark gives special access to the main storage system via
follow the instructions below:

1. Contact [email protected] to activate the permission to your
Treasure Data account.
Treasure Data account. Note that the underlying component, Plazma Public
API, limits its free tier at 100GB Read and 100TB Write.
2. Install pytd with ``[spark]`` option if you use the third option:
``pip install pytd[spark]``

Expand All @@ -146,7 +147,7 @@ Treasure Data offers three different Python clients on GitHub, and the following

- Basic REST API wrapper.
- Similar functionalities to td-client-{`ruby <https://github.com/treasure-data/td-client-ruby>`__, `java <https://github.com/treasure-data/td-client-java>`__, `node <https://github.com/treasure-data/td-client-node>`__, `go <https://github.com/treasure-data/td-client-go>`__}.
- The capability is limited by `what Treasure Data REST API can do <https://tddocs.atlassian.net/wiki/spaces/PD/pages/1085354/REST+APIs+in+Treasure+Data>`__.
- The capability is limited by `what Treasure Data REST API can do <https://docs.treasuredata.com/display/public/PD/REST+APIs+in+Treasure+Data>`__.

2. **pytd**

Expand Down
7 changes: 1 addition & 6 deletions doc/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,4 @@ Commit and push the latest code, and tag the version:
git tag 1.0.0
git push --tags
Build a package and upload to PyPI:

.. code:: sh
python setup.py sdist bdist_wheel
twine upload --skip-existing dist/*
`GitHub Actions Workflow <https://github.com/treasure-data/pytd/blob/master/.github/workflows/pypi.yml>`__ then automatically releases the tagged version on PyPI. A tag and version number must be identical and following the `semantic versioning convention <https://semver.org/>`__.
6 changes: 3 additions & 3 deletions pytd/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Client(object):
endpoint : str, optional
Treasure Data API server. If not given, ``https://api.treasuredata.com`` is
used by default. List of available endpoints is:
https://tddocs.atlassian.net/wiki/spaces/PD/pages/1085143/Sites+and+Endpoints
https://docs.treasuredata.com/display/public/PD/Sites+and+Endpoints
database : str, default: 'sample_datasets'
Name of connected database.
Expand Down Expand Up @@ -201,8 +201,8 @@ def query(self, query, engine=None, **kwargs):
- ``wait_interval`` (int): sleep interval until job finish
- ``wait_callback`` (function): called every interval against job itself
- ``engine_version`` (str): run query with Hive 2 if this parameter
is set to ``"experimental"`` and ``engine`` denotes Hive.
https://tddocs.atlassian.net/wiki/spaces/PD/pages/1083123/Using+Hive+2+to+Create+Queries
is set to ``"stable"`` and ``engine`` denotes Hive.
https://docs.treasuredata.com/display/public/PD/Writing+Hive+Queries
Meanwhile, when a following argument is set to ``True``, query is
deterministically issued via ``tdclient``.
Expand Down
6 changes: 3 additions & 3 deletions pytd/pandas_td/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def connect(apikey=None, endpoint=None, **kwargs):
endpoint : str, optional
Treasure Data API server. If not given, ``https://api.treasuredata.com`` is
used by default. List of available endpoints is:
https://tddocs.atlassian.net/wiki/spaces/PD/pages/1085143/Sites+and+Endpoints
https://docs.treasuredata.com/display/public/PD/Sites+and+Endpoints
kwargs : dict, optional
Optional arguments
Expand Down Expand Up @@ -173,8 +173,8 @@ def read_td_query(
- ``wait_interval`` (int): sleep interval until job finish
- ``wait_callback`` (function): called every interval against job itself
- ``engine_version`` (str): run query with Hive 2 if this parameter is
set to ``"experimental"`` in ``HiveQueryEngine``.
https://tddocs.atlassian.net/wiki/spaces/PD/pages/1083123/Using+Hive+2+to+Create+Queries
set to ``"stable"`` in ``HiveQueryEngine``.
https://docs.treasuredata.com/display/public/PD/Writing+Hive+Queries
Returns
-------
Expand Down
12 changes: 6 additions & 6 deletions pytd/query_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ def execute(self, query, **kwargs):
- ``wait_interval`` (int): sleep interval until job finish
- ``wait_callback`` (function): called every interval against job itself
- ``engine_version`` (str): run query with Hive 2 if this parameter
is set to ``"experimental"`` in ``HiveQueryEngine``.
https://tddocs.atlassian.net/wiki/spaces/PD/pages/1083123/Using+Hive+2+to+Create+Queries
is set to ``"stable"`` in ``HiveQueryEngine``.
https://docs.treasuredata.com/display/public/PD/Writing+Hive+Queries
Meanwhile, when a following argument is set to ``True``, query is
deterministically issued via ``tdclient``.
Expand Down Expand Up @@ -178,8 +178,8 @@ def _get_tdclient_cursor(self, con, **kwargs):
- ``wait_interval`` (int): sleep interval until job finish
- ``wait_callback`` (function): called every interval against job itself
- ``engine_version`` (str): run query with Hive 2 if this parameter
is set to ``"experimental"`` in ``HiveQueryEngine``.
https://tddocs.atlassian.net/wiki/spaces/PD/pages/1083123/Using+Hive+2+to+Create+Queries
is set to ``"stable"`` in ``HiveQueryEngine``.
https://docs.treasuredata.com/display/public/PD/Writing+Hive+Queries
Returns
-------
Expand Down Expand Up @@ -397,8 +397,8 @@ def cursor(self, force_tdclient=True, **kwargs):
- ``wait_interval`` (int): sleep interval until job finish
- ``wait_callback`` (function): called every interval against job itself
- ``engine_version`` (str): run query with Hive 2 if this parameter
is set to ``"experimental"``.
https://tddocs.atlassian.net/wiki/spaces/PD/pages/1083123/Using+Hive+2+to+Create+Queries
is set to ``"stable"``.
https://docs.treasuredata.com/display/public/PD/Writing+Hive+Queries
Returns
-------
Expand Down
2 changes: 1 addition & 1 deletion pytd/spark.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def fetch_td_spark_context(
endpoint : str, optional
Treasure Data API server. If not given, ``https://api.treasuredata.com`` is
used by default. List of available endpoints is:
https://tddocs.atlassian.net/wiki/spaces/PD/pages/1085143/Sites+and+Endpoints
https://docs.treasuredata.com/display/public/PD/Sites+and+Endpoints
td_spark_path : str, optional
Path to td-spark-assembly-{td-spark-version}_spark{spark-version}.jar.
Expand Down
2 changes: 1 addition & 1 deletion pytd/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def create(self, column_names=[], column_types=[]):
column_types : list of str, optional
Column types corresponding to the names. Note that Treasure Data
supports limited amount of types as documented in:
https://tddocs.atlassian.net/wiki/spaces/PD/pages/1083743/Schema+Management
https://docs.treasuredata.com/display/public/PD/Schema+Management
"""
if len(column_names) > 0:
schema = ", ".join(
Expand Down
2 changes: 1 addition & 1 deletion pytd/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def _insert_into(self, table, list_of_tuple, column_names, column_types, if_exis
column_types : list of str
Column types corresponding to the names. Note that Treasure Data
supports limited amount of types as documented in:
https://tddocs.atlassian.net/wiki/spaces/PD/pages/1083743/Schema+Management
https://docs.treasuredata.com/display/public/PD/Schema+Management
if_exists : {'error', 'overwrite', 'append', 'ignore'}
What happens when a target table already exists.
Expand Down

0 comments on commit 533457a

Please sign in to comment.