Skip to content

Commit 3aeba22

Browse files
authored
Merge branch 'main' into coercion
2 parents ec144ff + 79b131e commit 3aeba22

File tree

12 files changed

+32
-91
lines changed

12 files changed

+32
-91
lines changed

.github/workflows/scorecards.yml

Lines changed: 0 additions & 55 deletions
This file was deleted.

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
[![Package Status](https://img.shields.io/pypi/status/pandas.svg)](https://pypi.org/project/pandas/)
1212
[![License](https://img.shields.io/pypi/l/pandas.svg)](https://github.com/pandas-dev/pandas/blob/main/LICENSE)
1313
[![Coverage](https://codecov.io/github/pandas-dev/pandas/coverage.svg?branch=main)](https://codecov.io/gh/pandas-dev/pandas)
14-
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/pandas-dev/pandas/badge)](https://api.securityscorecards.dev/projects/github.com/pandas-dev/pandas)
1514
[![Downloads](https://static.pepy.tech/personalized-badge/pandas?period=month&units=international_system&left_color=black&right_color=orange&left_text=PyPI%20downloads%20per%20month)](https://pepy.tech/project/pandas)
1615
[![Slack](https://img.shields.io/badge/join_Slack-information-brightgreen.svg?logo=slack)](https://pandas.pydata.org/docs/dev/development/community.html?highlight=slack#community-slack)
1716
[![Powered by NumFOCUS](https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A)](https://numfocus.org)

doc/source/getting_started/comparison/comparison_with_sas.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ The pandas method is :func:`read_csv`, which works similarly.
112112
.. ipython:: python
113113
114114
url = (
115-
"https://raw.github.com/pandas-dev/"
115+
"https://raw.githubusercontent.com/pandas-dev/"
116116
"pandas/main/pandas/tests/io/data/csv/tips.csv"
117117
)
118118
tips = pd.read_csv(url)

doc/source/getting_started/comparison/comparison_with_spreadsheets.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ In pandas, you pass the URL or local path of the CSV file to :func:`~pandas.read
100100
.. ipython:: python
101101
102102
url = (
103-
"https://raw.github.com/pandas-dev"
103+
"https://raw.githubusercontent.com/pandas-dev"
104104
"/pandas/main/pandas/tests/io/data/csv/tips.csv"
105105
)
106106
tips = pd.read_csv(url)

doc/source/getting_started/comparison/comparison_with_sql.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ structure.
1717
.. ipython:: python
1818
1919
url = (
20-
"https://raw.github.com/pandas-dev"
20+
"https://raw.githubusercontent.com/pandas-dev"
2121
"/pandas/main/pandas/tests/io/data/csv/tips.csv"
2222
)
2323
tips = pd.read_csv(url)

doc/source/getting_started/comparison/comparison_with_stata.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ the data set if presented with a url.
108108
.. ipython:: python
109109
110110
url = (
111-
"https://raw.github.com/pandas-dev"
111+
"https://raw.githubusercontent.com/pandas-dev"
112112
"/pandas/main/pandas/tests/io/data/csv/tips.csv"
113113
)
114114
tips = pd.read_csv(url)

doc/source/user_guide/io.rst

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5790,21 +5790,6 @@ Specifying this will return an iterator through chunks of the query result:
57905790
for chunk in pd.read_sql_query("SELECT * FROM data_chunks", engine, chunksize=5):
57915791
print(chunk)
57925792
5793-
You can also run a plain query without creating a ``DataFrame`` with
5794-
:func:`~pandas.io.sql.execute`. This is useful for queries that don't return values,
5795-
such as INSERT. This is functionally equivalent to calling ``execute`` on the
5796-
SQLAlchemy engine or db connection object. Again, you must use the SQL syntax
5797-
variant appropriate for your database.
5798-
5799-
.. code-block:: python
5800-
5801-
from pandas.io import sql
5802-
5803-
sql.execute("SELECT * FROM table_name", engine)
5804-
sql.execute(
5805-
"INSERT INTO table_name VALUES(?, ?, ?)", engine, params=[("id", 1, 12.2, True)]
5806-
)
5807-
58085793
58095794
Engine connection examples
58105795
''''''''''''''''''''''''''

pandas/io/sql.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,7 @@ def execute(sql, con, params=None):
192192
----------
193193
sql : string
194194
SQL query to be executed.
195-
con : SQLAlchemy connectable(engine/connection) or sqlite3 connection
196-
Using SQLAlchemy makes it possible to use any DB supported by the
197-
library.
195+
con : SQLAlchemy connection or sqlite3 connection
198196
If a DBAPI2 object, only sqlite3 is supported.
199197
params : list or tuple, optional, default: None
200198
List of parameters to pass to execute method.
@@ -203,6 +201,10 @@ def execute(sql, con, params=None):
203201
-------
204202
Results Iterable
205203
"""
204+
sqlalchemy = import_optional_dependency("sqlalchemy", errors="ignore")
205+
206+
if sqlalchemy is not None and isinstance(con, (str, sqlalchemy.engine.Engine)):
207+
raise TypeError("pandas.io.sql.execute requires a connection") # GH50185
206208
with pandasSQL_builder(con, need_transaction=True) as pandas_sql:
207209
args = _convert_params(sql, params)
208210
return pandas_sql.execute(*args)

pandas/plotting/_misc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ def andrews_curves(
311311
:context: close-figs
312312
313313
>>> df = pd.read_csv(
314-
... 'https://raw.github.com/pandas-dev/'
314+
... 'https://raw.githubusercontent.com/pandas-dev/'
315315
... 'pandas/main/pandas/tests/io/data/csv/iris.csv'
316316
... )
317317
>>> pd.plotting.andrews_curves(df, 'Name')
@@ -443,7 +443,7 @@ def parallel_coordinates(
443443
:context: close-figs
444444
445445
>>> df = pd.read_csv(
446-
... 'https://raw.github.com/pandas-dev/'
446+
... 'https://raw.githubusercontent.com/pandas-dev/'
447447
... 'pandas/main/pandas/tests/io/data/csv/iris.csv'
448448
... )
449449
>>> pd.plotting.parallel_coordinates(

pandas/tests/io/parser/common/test_file_buffer_url.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
@pytest.mark.network
3131
@tm.network(
3232
url=(
33-
"https://raw.github.com/pandas-dev/pandas/main/"
33+
"https://raw.githubusercontent.com/pandas-dev/pandas/main/"
3434
"pandas/tests/io/parser/data/salaries.csv"
3535
),
3636
check_before_test=True,
@@ -40,7 +40,7 @@ def test_url(all_parsers, csv_dir_path):
4040
kwargs = {"sep": "\t"}
4141

4242
url = (
43-
"https://raw.github.com/pandas-dev/pandas/main/"
43+
"https://raw.githubusercontent.com/pandas-dev/pandas/main/"
4444
"pandas/tests/io/parser/data/salaries.csv"
4545
)
4646
url_result = parser.read_csv(url, **kwargs)

0 commit comments

Comments
 (0)