Skip to content

Commit 95abb3c

Browse files
Merge pull request #8266 from jnmclarty/SQL_params_note
DOC: Add notes explaining params is db driver dep. GH7573
2 parents 4179245 + d450387 commit 95abb3c

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

pandas/io/sql.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,11 @@ def read_sql_query(sql, con, index_col=None, coerce_float=True, params=None,
341341
Attempt to convert values to non-string, non-numeric objects (like
342342
decimal.Decimal) to floating point, useful for SQL result sets
343343
params : list, tuple or dict, optional
344-
List of parameters to pass to execute method.
344+
List of parameters to pass to execute method. The syntax used
345+
to pass parameters is database driver dependent. Check your
346+
database driver documentation for which of the five syntax styles,
347+
described in PEP 249's paramstyle, is supported.
348+
Eg. for psycopg2, uses %(name)s so use params={'name' : 'value'}
345349
parse_dates : list or dict
346350
- List of column names to parse as dates
347351
- Dict of ``{column_name: format string}`` where format string is
@@ -387,7 +391,11 @@ def read_sql(sql, con, index_col=None, coerce_float=True, params=None,
387391
Attempt to convert values to non-string, non-numeric objects (like
388392
decimal.Decimal) to floating point, useful for SQL result sets
389393
params : list, tuple or dict, optional
390-
List of parameters to pass to execute method.
394+
List of parameters to pass to execute method. The syntax used
395+
to pass parameters is database driver dependent. Check your
396+
database driver documentation for which of the five syntax styles,
397+
described in PEP 249's paramstyle, is supported.
398+
Eg. for psycopg2, uses %(name)s so use params={'name' : 'value'}
391399
parse_dates : list or dict
392400
- List of column names to parse as dates
393401
- Dict of ``{column_name: format string}`` where format string is

0 commit comments

Comments
 (0)