You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/user_guide/loading_data/connect_legacy.rst
+19-15Lines changed: 19 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -69,7 +69,7 @@ For example:
69
69
Local Storage
70
70
=============
71
71
72
-
To open a dataset from a local source, use ``ADSDataset`` and specify the path of the data file:
72
+
To open a dataset from a local source, use ``pandas`` to load the file into a dataframe, convert it to ``ADSDataset`` and specify the path of the data file:
73
73
74
74
.. code-block:: python3
75
75
@@ -128,10 +128,16 @@ You can also use ``cx_Oracle`` within ADS by creating a connection string:
You can use ADS to query a table from your database, and then load that table as an ``ADSDatasetWithTarget`` object.
159
-
When you open ``ADSDatasetWithTarget``, specify the name of the table you want to pull using the ``table`` variable for a given table. For SQL expressions, use the table parameter also. For example, *(`table="SELECT * FROM sh.times WHERE rownum <= 30"`)*.
158
+
You can use ADS to query a table from your database, by loading that database as a pandas dataframe and convert it to an ``ADSDataset`` or ``ADSDatasetWithTarget`` object.
159
+
When you call ``pandas``, specify the name of the table you want to pull.
with cx_Oracle.connect(creds['user'], creds['password'], creds['sid']) as ora_conn:
165
+
ds = ADSDatasetWithTarget(
166
+
df=pd.read_sql_table(table, con=ora_conn),
167
+
target='label'
168
+
)
165
169
166
170
Query ADB
167
171
---------
@@ -291,7 +295,7 @@ You can open Amazon S3 public or private files in ADS. For private files, you mu
291
295
HTTP(S) Sources
292
296
===============
293
297
294
-
To open a dataset from a remote web server source, use ``ADSDatasetWithTarget`` and specify the URL of the data:
298
+
To open a dataset from a remote web server source, use ``pandas`` to load the data from URL, convert it to ``ADSDataset`` or ``ADSDatasetWithTarget`` and specify the URL of the data:
0 commit comments