selection_rank
int64
0
10k
uid
stringlengths
17
29
source
stringclasses
7 values
split
stringclasses
3 values
row_idx
int64
0
58.9k
instance_id
stringlengths
14
120
repo
stringclasses
246 values
repo_canon
stringclasses
232 values
language
stringclasses
8 values
base_commit
stringlengths
40
40
⌀
problem_statement
stringlengths
84
23.6k
extra_context
stringclasses
626 values
hints
stringlengths
0
59.3k
patch
stringlengths
252
175k
test_patch
stringlengths
0
358k
f2p
stringlengths
10
155k
⌀
p2p
stringlengths
2
1.75M
⌀
env_image
stringlengths
41
154
⌀
env_available
bool
1 class
created_at
stringlengths
10
20
⌀
n_src_files
int64
1
15
src_lines
int64
1
1.48k
n_f2p
float64
1
1.87k
⌀
ps_chars
int64
84
23.6k
leak_ratio
float64
0
0.6
s_prior
float64
0.6
1
s_verif
float64
0.75
1
s_ps
float64
0.04
1
s_patch
float64
0.07
1
s_tiebreak
float64
0.02
1
score
float64
47.9
98.6
0
swe_bench_verified::test::23
swe_bench_verified
test
23
django__django-10554
django/django
django/django
python
14d026cccb144c6877294ba4cd4e03ebf0842498
Union queryset with ordering breaks on ordering with derived querysets Description (last modified by Sergei Maertens) May be related to #29692 Simple reproduction (the exact models are not relevant I think): >>> Dimension.objects.values_list('id', flat=True) <QuerySet [10, 11, 12, 13, 14, 15, 16, 17, 18]> >>> qs = ...
Looks like a bug caused by a .query attribute change without performing a prior copy() of the query/queryset. Attaching a regression test that fails on master (tested at f3d3338e06d571a529bb2046428eeac8e56bcbf6). ​PR Tests aren't passing. Needs more tests, at the least. But discussion on PR suggests we've not hit the r...
diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py --- a/django/db/models/sql/compiler.py +++ b/django/db/models/sql/compiler.py @@ -356,7 +356,12 @@ def get_order_by(self): resolved.set_source_expressions([RawSQL('%d' % (idx + 1), ())]) br...
diff --git a/tests/queries/test_qs_combinators.py b/tests/queries/test_qs_combinators.py --- a/tests/queries/test_qs_combinators.py +++ b/tests/queries/test_qs_combinators.py @@ -153,6 +153,29 @@ def test_union_with_values_list_on_annotated_and_unannotated(self): qs2 = Number.objects.filter(num=9) sel...
["test_union_with_values_list_and_order (queries.test_qs_combinators.QuerySetSetOperationTests)", "test_union_with_values_list_on_annotated_and_unannotated (queries.test_qs_combinators.QuerySetSetOperationTests)"]
["test_combining_multiple_models (queries.test_qs_combinators.QuerySetSetOperationTests)", "test_count_difference (queries.test_qs_combinators.QuerySetSetOperationTests)", "test_count_intersection (queries.test_qs_combinators.QuerySetSetOperationTests)", "test_count_union (queries.test_qs_combinators.QuerySetSetOperati...
null
true
2018-10-24T14:24:45Z
2
11
2
2,904
0
1
1
1
1
0.520667
98.562
1
swe_bench_verified::test::359
swe_bench_verified
test
359
scikit-learn__scikit-learn-13142
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
1c8668b0a021832386470ddf740d834e02c66f69
GaussianMixture predict and fit_predict disagree when n_init>1 #### Description When `n_init` is specified in GaussianMixture, the results of fit_predict(X) and predict(X) are often different. The `test_gaussian_mixture_fit_predict` unit test doesn't catch this because it does not set `n_init`. #### Steps/Code to Rep...
Indeed the code in fit_predict and the one in predict are not exactly consistent. This should be fixed but we would need to check the math to choose the correct variant, add a test and remove the other one. I don't think the math is wrong or inconsistent. I think it's a matter of `fit_predict` returning the fit from t...
diff --git a/sklearn/mixture/base.py b/sklearn/mixture/base.py --- a/sklearn/mixture/base.py +++ b/sklearn/mixture/base.py @@ -257,11 +257,6 @@ def fit_predict(self, X, y=None): best_params = self._get_parameters() best_n_iter = n_iter - # Always do a final e-step to guarantee...
diff --git a/sklearn/mixture/tests/test_bayesian_mixture.py b/sklearn/mixture/tests/test_bayesian_mixture.py --- a/sklearn/mixture/tests/test_bayesian_mixture.py +++ b/sklearn/mixture/tests/test_bayesian_mixture.py @@ -451,6 +451,15 @@ def test_bayesian_mixture_fit_predict(seed, max_iter, tol): assert_array_eq...
["sklearn/mixture/tests/test_bayesian_mixture.py::test_bayesian_mixture_fit_predict_n_init", "sklearn/mixture/tests/test_gaussian_mixture.py::test_gaussian_mixture_fit_predict_n_init"]
["sklearn/mixture/tests/test_bayesian_mixture.py::test_log_dirichlet_norm", "sklearn/mixture/tests/test_bayesian_mixture.py::test_log_wishart_norm", "sklearn/mixture/tests/test_bayesian_mixture.py::test_bayesian_mixture_covariance_type", "sklearn/mixture/tests/test_bayesian_mixture.py::test_bayesian_mixture_weight_conc...
null
true
2019-02-12T14:32:37Z
1
10
2
2,240
0
1
1
1
1
0.406667
98.22
2
swe_bench_verified::test::365
swe_bench_verified
test
365
scikit-learn__scikit-learn-14087
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
a5743ed36fbd3fbc8e351bdab16561fbfca7dfa1
IndexError thrown with LogisticRegressionCV and refit=False #### Description The following error is thrown when trying to estimate a regularization parameter via cross-validation, *without* refitting. #### Steps/Code to Reproduce ```python import sys import sklearn from sklearn.linear_model import LogisticRegressionCV...
I.e. coefs_paths.ndim < 4? I haven't tried to reproduce yet, but thanks for the minimal example. Are you able to check if this was introduced in 0.21? Yes - the example above works with scikit-learn==0.20.3. Full versions: ``` System: python: 3.6.8 (default, Jun 4 2019, 11:38:34) [GCC 4.2.1 Compatible Apple ...
diff --git a/sklearn/linear_model/logistic.py b/sklearn/linear_model/logistic.py --- a/sklearn/linear_model/logistic.py +++ b/sklearn/linear_model/logistic.py @@ -2170,7 +2170,7 @@ def fit(self, X, y, sample_weight=None): # Take the best scores across every fold and the average of # al...
diff --git a/sklearn/linear_model/tests/test_logistic.py b/sklearn/linear_model/tests/test_logistic.py --- a/sklearn/linear_model/tests/test_logistic.py +++ b/sklearn/linear_model/tests/test_logistic.py @@ -1532,8 +1532,9 @@ def test_LogisticRegressionCV_GridSearchCV_elastic_net_ovr(): assert (lrcv.predict(X_test)...
["sklearn/linear_model/tests/test_logistic.py::test_LogisticRegressionCV_no_refit[ovr-l2]", "sklearn/linear_model/tests/test_logistic.py::test_LogisticRegressionCV_no_refit[multinomial-l2]", "sklearn/linear_model/tests/test_logistic.py::test_LogisticRegressionCV_no_refit[auto-l2]"]
["sklearn/linear_model/tests/test_logistic.py::test_predict_2_classes", "sklearn/linear_model/tests/test_logistic.py::test_error", "sklearn/linear_model/tests/test_logistic.py::test_logistic_cv_mock_scorer", "sklearn/linear_model/tests/test_logistic.py::test_logistic_cv_score_does_not_warn_by_default", "sklearn/linear_...
null
true
2019-06-13T20:09:22Z
1
9
3
2,243
0
1
1
1
1
0.403833
98.2115
3
swe_bench_verified::test::138
swe_bench_verified
test
138
django__django-14011
django/django
django/django
python
e4430f22c8e3d29ce5d9d0263fba57121938d06d
LiveServerTestCase's ThreadedWSGIServer doesn't close database connections after each thread Description In Django 2.2.17, I'm seeing the reappearance of #22414 after it was fixed in 1.11. #22414 is the issue where the following error will occur at the conclusion of a test run when destroy_test_db() is called: Operati...
I wonder if this issue is because ThreadingMixIn creates a new thread for each request, but those threads don't close their database connections at their conclusion, e.g. like LiveServerThread does. Here is the code in CPython for ThreadingMixIn's process_request() and server_close(): ​https://github.com/python/cpython...
diff --git a/django/core/servers/basehttp.py b/django/core/servers/basehttp.py --- a/django/core/servers/basehttp.py +++ b/django/core/servers/basehttp.py @@ -16,6 +16,7 @@ from django.core.exceptions import ImproperlyConfigured from django.core.handlers.wsgi import LimitedStream from django.core.wsgi import get_wsg...
diff --git a/django/test/testcases.py b/django/test/testcases.py --- a/django/test/testcases.py +++ b/django/test/testcases.py @@ -1513,11 +1513,12 @@ def run(self): finally: connections.close_all() - def _create_server(self): + def _create_server(self, connections_override=None): ...
["test_live_server_url_is_class_property (servers.tests.LiveServerAddress)", "Data written to the database by a view can be read.", "Fixtures are properly loaded and visible to the live server thread.", "test_check_model_instance_from_subview (servers.tests.LiveServerThreadedTests)", "test_view_calls_subview (servers.t...
["test_set_up_class (servers.tests.LiveServerTestCaseSetupTest)", "Contrast to"]
null
true
2021-02-15T06:15:21Z
2
24
17
1,905
0
1
1
1
1
0.3975
98.1925
4
swe_bench_verified::test::368
swe_bench_verified
test
368
scikit-learn__scikit-learn-14629
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
4aded39b5663d943f6a4809abacfa9cae3d7fb6a
AttributeError with cross_val_predict(method='predict_proba') when using MultiOuputClassifier #### Description I believe there is a bug when using `cross_val_predict(method='predict_proba')` with a `MultiOutputClassifer`. I think the problem is in the use of `estimator.classes_` here: https://github.com/scikit-learn/s...
Please provide the full traceback to make it easier for us to see where the error is raised. I will admit I'm surprised this still has issues, but it is a surprisingly complicated bit of code. I think this bug is in MultiOutputClassifier. All classifiers should store `classes_` when fitted. Help wanted to add `classes...
diff --git a/sklearn/multioutput.py b/sklearn/multioutput.py --- a/sklearn/multioutput.py +++ b/sklearn/multioutput.py @@ -325,6 +325,28 @@ class MultiOutputClassifier(MultiOutputEstimator, ClassifierMixin): def __init__(self, estimator, n_jobs=None): super().__init__(estimator, n_jobs) + def fit(sel...
diff --git a/sklearn/tests/test_multioutput.py b/sklearn/tests/test_multioutput.py --- a/sklearn/tests/test_multioutput.py +++ b/sklearn/tests/test_multioutput.py @@ -527,3 +527,20 @@ def test_base_chain_crossval_fit_and_predict(): assert jaccard_score(Y, Y_pred_cv, average='samples') > .4 else: ...
["sklearn/tests/test_multioutput.py::test_multi_output_classes_[estimator1]"]
["sklearn/tests/test_multioutput.py::test_multi_target_regression", "sklearn/tests/test_multioutput.py::test_multi_target_regression_partial_fit", "sklearn/tests/test_multioutput.py::test_multi_target_regression_one_target", "sklearn/tests/test_multioutput.py::test_multi_target_sparse_regression", "sklearn/tests/test_m...
null
true
2019-08-12T09:31:54Z
1
24
1
1,751
0
1
1
1
1
0.371833
98.1155
5
swe_bench_verified::test::377
swe_bench_verified
test
377
scikit-learn__scikit-learn-25973
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
10dbc142bd17ccf7bd38eec2ac04b52ce0d1009e
Unable to pass splits to SequentialFeatureSelector ### Describe the bug This runs fine with e.g. `cv=5`, but according to the documentation, it should also be able to take an iterable of splits. However, passing splits from the cross validator fails Im fairly certain I have done similar things in the past to other cl...
The internal algorithm will use the `cv` parameter in a `for` loop. If `cv` is a generator, it will be consumed at the first iteration only. Later it trigger the error because we did not complete the other iteration of the `for` loop. Passing a list (e.g. `cv=list(splits)`) will solve the problem because we can reus...
diff --git a/sklearn/feature_selection/_sequential.py b/sklearn/feature_selection/_sequential.py --- a/sklearn/feature_selection/_sequential.py +++ b/sklearn/feature_selection/_sequential.py @@ -8,12 +8,12 @@ import warnings from ._base import SelectorMixin -from ..base import BaseEstimator, MetaEstimatorMixin, clo...
diff --git a/sklearn/feature_selection/tests/test_sequential.py b/sklearn/feature_selection/tests/test_sequential.py --- a/sklearn/feature_selection/tests/test_sequential.py +++ b/sklearn/feature_selection/tests/test_sequential.py @@ -6,11 +6,12 @@ from sklearn.preprocessing import StandardScaler from sklearn.pipelin...
["sklearn/feature_selection/tests/test_sequential.py::test_cv_generator_support"]
["sklearn/feature_selection/tests/test_sequential.py::test_bad_n_features_to_select", "sklearn/feature_selection/tests/test_sequential.py::test_n_features_to_select[1-forward]", "sklearn/feature_selection/tests/test_sequential.py::test_n_features_to_select[1-backward]", "sklearn/feature_selection/tests/test_sequential....
null
true
2023-03-25T13:27:07Z
1
12
1
1,919
0
1
1
1
1
0.359833
98.0795
6
swe_bench_verified::test::397
swe_bench_verified
test
397
sphinx-doc__sphinx-7985
sphinx-doc/sphinx
sphinx-doc/sphinx
python
f30284ef926ebaf04b176f21b421e2dffc679792
linkcheck could also check local (internal) links Subject: linkcheck currently doesn't check local (internal) links, but this would be useful. ### Problem See above. #### Procedure to reproduce the problem Create a template project with sphinx-quickstart, put the following in index.rst ``` broken external-link_ broke...
+0: It might be useful. But all we can check is only inside sphinx-document. If users copy extra file in deploy script, we'll misdetect broken links. And it is hard if local hyperlink is absolute path. We don't know where the document will be placed. At least this could be an optional feature; I'd guess there are a lot...
diff --git a/sphinx/builders/linkcheck.py b/sphinx/builders/linkcheck.py --- a/sphinx/builders/linkcheck.py +++ b/sphinx/builders/linkcheck.py @@ -35,6 +35,8 @@ logger = logging.getLogger(__name__) +uri_re = re.compile('[a-z]+://') + DEFAULT_REQUEST_HEADERS = { 'Accept': 'text/html,application/xhtml+xml;q=...
diff --git a/tests/roots/test-linkcheck/links.txt b/tests/roots/test-linkcheck/links.txt --- a/tests/roots/test-linkcheck/links.txt +++ b/tests/roots/test-linkcheck/links.txt @@ -11,6 +11,8 @@ Some additional anchors to exercise ignore code * `Example Bar invalid <https://www.google.com/#top>`_ * `Example anchor inva...
["tests/test_build_linkcheck.py::test_defaults", "tests/test_build_linkcheck.py::test_anchors_ignored"]
["tests/test_build_linkcheck.py::test_defaults_json", "tests/test_build_linkcheck.py::test_auth", "tests/test_build_linkcheck.py::test_linkcheck_request_headers"]
null
true
2020-07-19T10:09:07Z
1
17
2
1,444
0
1
1
1
1
0.297333
97.892
7
swe_bench_verified::test::61
swe_bench_verified
test
61
django__django-11815
django/django
django/django
python
e02f67ef2d03d48128e7a118bf75f0418e24e8ac
Migrations uses value of enum object instead of its name. Description (last modified by oasl) When using Enum object as a default value for a CharField, the generated migration file uses the value of the Enum object instead of the its name. This causes a problem when using Django translation on the value of the Enu...
Thanks for this report, however I'm not sure how translated values can brake migrations. Can you provide a sample project to reproduce this issue? Migrations with translatable strings works fine for me: >>> class TextEnum(enum.Enum): ... C = _('translatable value') ... >>> TextEnum(_('translatable value')) <TextEnum.C:...
diff --git a/django/db/migrations/serializer.py b/django/db/migrations/serializer.py --- a/django/db/migrations/serializer.py +++ b/django/db/migrations/serializer.py @@ -120,9 +120,10 @@ class EnumSerializer(BaseSerializer): def serialize(self): enum_class = self.value.__class__ module = enum_cl...
diff --git a/tests/migrations/test_writer.py b/tests/migrations/test_writer.py --- a/tests/migrations/test_writer.py +++ b/tests/migrations/test_writer.py @@ -257,6 +257,10 @@ class TextEnum(enum.Enum): A = 'a-value' B = 'value-b' + class TextTranslatedEnum(enum.Enum): + A ...
["test_serialize_class_based_validators (migrations.test_writer.WriterTests)", "test_serialize_enums (migrations.test_writer.WriterTests)"]
["test_args_kwargs_signature (migrations.test_writer.OperationWriterTests)", "test_args_signature (migrations.test_writer.OperationWriterTests)", "test_empty_signature (migrations.test_writer.OperationWriterTests)", "test_expand_args_signature (migrations.test_writer.OperationWriterTests)", "test_kwargs_signature (migr...
null
true
2019-09-24T21:45:36Z
1
7
2
1,595
0
1
1
1
1
0.289167
97.8675
8
swe_bench_verified::test::391
swe_bench_verified
test
391
sphinx-doc__sphinx-7462
sphinx-doc/sphinx
sphinx-doc/sphinx
python
b3e26a6c851133b82b50f4b68b53692076574d13
`IndexError: pop from empty list` for empty tuple type annotation **Describe the bug** Following notation for empty tuple from [this mypy issue](https://github.com/python/mypy/issues/4211) like ```python from typing import Tuple def foo() -> Tuple[()]: """Sample text.""" return () ``` I get ```bash File "\path\...
Changing https://github.com/sphinx-doc/sphinx/blob/b3e26a6c851133b82b50f4b68b53692076574d13/sphinx/domains/python.py#L117-L122 to ```python if node.elts: result = [] for elem in node.elts: result.extend(unparse(elem)) result.app...
diff --git a/sphinx/domains/python.py b/sphinx/domains/python.py --- a/sphinx/domains/python.py +++ b/sphinx/domains/python.py @@ -105,11 +105,16 @@ def unparse(node: ast.AST) -> List[Node]: result.append(addnodes.desc_sig_punctuation('', ']')) return result elif isinstance(node, ast....
diff --git a/tests/test_domain_py.py b/tests/test_domain_py.py --- a/tests/test_domain_py.py +++ b/tests/test_domain_py.py @@ -255,6 +255,13 @@ def test_parse_annotation(): [pending_xref, "int"], [desc_sig_punctuation, "]"])) + doctree = _parse_annotation("Tupl...
["tests/test_domain_py.py::test_parse_annotation", "tests/test_pycode_ast.py::test_unparse[()-()]"]
["tests/test_domain_py.py::test_function_signatures", "tests/test_domain_py.py::test_domain_py_xrefs", "tests/test_domain_py.py::test_domain_py_objects", "tests/test_domain_py.py::test_resolve_xref_for_properties", "tests/test_domain_py.py::test_domain_py_find_obj", "tests/test_domain_py.py::test_get_full_qualified_nam...
null
true
2020-04-12T04:10:05Z
2
20
2
1,130
0
1
1
1
1
0.255
97.765
9
swe_bench_verified::test::1
swe_bench_verified
test
1
astropy__astropy-13033
astropy/astropy
astropy/astropy
python
298ccb478e6bf092953bca67a3d29dc6c35f6752
TimeSeries: misleading exception when required column check fails. ### Description For a `TimeSeries` object that has additional required columns (in addition to `time`), when codes mistakenly try to remove a required column, the exception it produces is misleading. ### Expected behavior An exception that informs t...
The relevant code that produces the misleading exception. https://github.com/astropy/astropy/blob/00ccfe76113dca48d19396986872203dc2e978d7/astropy/timeseries/core.py#L77-L82 It works under the assumption that `time` is the only required column. So when a `TimeSeries` object has additional required columns, the me...
diff --git a/astropy/timeseries/core.py b/astropy/timeseries/core.py --- a/astropy/timeseries/core.py +++ b/astropy/timeseries/core.py @@ -55,6 +55,13 @@ class BaseTimeSeries(QTable): _required_columns_relax = False def _check_required_columns(self): + def as_scalar_or_list_str(obj): + if ...
diff --git a/astropy/timeseries/tests/test_sampled.py b/astropy/timeseries/tests/test_sampled.py --- a/astropy/timeseries/tests/test_sampled.py +++ b/astropy/timeseries/tests/test_sampled.py @@ -395,6 +395,14 @@ def test_required_columns(): assert exc.value.args[0] == ("TimeSeries object is invalid - expected " ...
["astropy/timeseries/tests/test_sampled.py::test_required_columns"]
["astropy/timeseries/tests/test_sampled.py::test_empty_initialization", "astropy/timeseries/tests/test_sampled.py::test_empty_initialization_invalid", "astropy/timeseries/tests/test_sampled.py::test_initialize_only_time", "astropy/timeseries/tests/test_sampled.py::test_initialization_with_data", "astropy/timeseries/tes...
null
true
2022-03-31T23:28:27Z
1
14
1
1,039
0
1
1
1
1
0.219833
97.6595
10
swe_bench_verified::test::316
swe_bench_verified
test
316
pydata__xarray-6992
pydata/xarray
pydata/xarray
python
45c0a114e2b7b27b83c9618bc05b36afac82183c
index refactor: more `_coord_names` than `_variables` on Dataset ### What happened? `xr.core.dataset.DataVariables` assumes that everything that is in `ds._dataset._variables` and not in `self._dataset._coord_names` is a "data variable". However, since the index refactor we can end up with more `_coord_names` than `_v...
diff --git a/xarray/core/dataset.py b/xarray/core/dataset.py --- a/xarray/core/dataset.py +++ b/xarray/core/dataset.py @@ -4026,10 +4026,11 @@ def set_index( dim_coords = either_dict_or_kwargs(indexes, indexes_kwargs, "set_index") new_indexes: dict[Hashable, Index] = {} - new_variables: dict[...
diff --git a/xarray/tests/test_dataarray.py b/xarray/tests/test_dataarray.py --- a/xarray/tests/test_dataarray.py +++ b/xarray/tests/test_dataarray.py @@ -2007,7 +2007,6 @@ def test_set_index(self) -> None: def test_reset_index(self) -> None: indexes = [self.mindex.get_level_values(n) for n in self.mindex...
["xarray/tests/test_dataarray.py::TestDataArray::test_reset_index", "xarray/tests/test_dataset.py::TestDataset::test_reset_index", "xarray/tests/test_dataset.py::TestDataset::test_reset_index_drop_dims", "xarray/tests/test_dataset.py::TestDataset::test_reset_index_drop_convert[foo-False-dropped0-converted0-renamed0]", ...
["xarray/tests/test_dataarray.py::TestDataArray::test_repr", "xarray/tests/test_dataarray.py::TestDataArray::test_repr_multiindex", "xarray/tests/test_dataarray.py::TestDataArray::test_repr_multiindex_long", "xarray/tests/test_dataarray.py::TestDataArray::test_properties", "xarray/tests/test_dataarray.py::TestDataArray...
null
true
2022-09-05T15:07:43Z
2
123
12
1,544
0
1
1
1
1
0.667333
97.002
11
swe_gym::train::519
swe_gym
train
519
python__mypy-10864
python/mypy
python/mypy
python
97b3b90356893e2a9f6947ebe52b41cd54ab1cb7
__slots__ isn't effective for limiting attributes **Bug Report** Thank you for Mypy! It's been great help :) Recently, I want to use `__slots__` in a class definition to limit the attributes. This way I don't accidentally define attributes with similar but different names (like "bar" in one class but "baz" in another...
I don't think mypy has any support for `__slots__`. I recently added [this support to pyright](https://github.com/microsoft/pyright/issues/2022#issuecomment-868199513). It should be straightforward for someone familiar with the mypy source base to add similar support to mypy. I've made a really small prototype that kin...
diff --git a/mypy/checker.py b/mypy/checker.py --- a/mypy/checker.py +++ b/mypy/checker.py @@ -2189,6 +2189,7 @@ def check_assignment(self, lvalue: Lvalue, rvalue: Expression, infer_lvalue_type if not inferred.is_final: rvalue_type = remove_instance_last_known_values(rvalue_type) ...
diff --git a/mypy/test/testcheck.py b/mypy/test/testcheck.py --- a/mypy/test/testcheck.py +++ b/mypy/test/testcheck.py @@ -96,6 +96,7 @@ 'check-typeguard.test', 'check-functools.test', 'check-singledispatch.test', + 'check-slots.test', ] # Tests that use Python 3.8-only AST features (like expressi...
["mypy/test/testcheck.py::TypeCheckSuite::testSlotsAssignmentEmptySlots", "mypy/test/testcheck.py::TypeCheckSuite::testSlotsDefinitionWithClassVar", "mypy/test/testcheck.py::TypeCheckSuite::testSlotsAssignmentWithMixin", "mypy/test/testcheck.py::TypeCheckSuite::testSlotsAssignmentWithProps", "mypy/test/testcheck.py::Ty...
["mypy/test/testcheck.py::TypeCheckSuite::testSlotsDefinitionMultipleVars1", "mypy/test/testcheck.py::TypeCheckSuite::testSlotsAssignmentWithoutSuperMixingSlots", "mypy/test/testcheck.py::TypeCheckSuite::testSlotsDefinitionOutsideOfClass", "mypy/test/testcheck.py::TypeCheckSuite::testSlotsAssignmentWithoutSuperSlots", ...
null
true
2021-07-24T16:18:12Z
3
116
11
2,024
0
0.85
1
1
1
0.724
96.322
12
swe_bench_verified::test::334
swe_bench_verified
test
334
pytest-dev__pytest-5631
pytest-dev/pytest
pytest-dev/pytest
python
cb828ebe70b4fa35cd5f9a7ee024272237eab351
ValueError when collecting tests that patch an array I'm trying to run pytest with a test file that contains patch where "new" is an array, for example: from unittest.mock import patch @patch(target='XXXXXX', new=np.array([-5.5, 3.0])) ... This works fine with pytest 3.1.3, but when using pytest 3.6.0 the following e...
diff --git a/src/_pytest/compat.py b/src/_pytest/compat.py --- a/src/_pytest/compat.py +++ b/src/_pytest/compat.py @@ -64,13 +64,18 @@ def num_mock_patch_args(function): patchings = getattr(function, "patchings", None) if not patchings: return 0 - mock_modules = [sys.modules.get("mock"), sys.modul...
diff --git a/testing/python/integration.py b/testing/python/integration.py --- a/testing/python/integration.py +++ b/testing/python/integration.py @@ -178,6 +178,34 @@ def test_hello_mock(self, abspath): reprec = testdir.inline_run() reprec.assertoutcome(passed=2) + def test_mock_sentinel_check_a...
["testing/python/integration.py::TestMockDecoration::test_mock_sentinel_check_against_numpy_like"]
["testing/python/integration.py::test_wrapped_getfslineno", "testing/python/integration.py::TestMockDecoration::test_wrapped_getfuncargnames", "testing/python/integration.py::TestMockDecoration::test_getfuncargnames_patching", "testing/python/integration.py::test_pytestconfig_is_session_scoped", "testing/python/integra...
null
true
2019-07-19T20:13:12Z
1
19
1
2,174
0
1
1
1
1
0.425667
96.277
13
swe_bench_verified::test::267
swe_bench_verified
test
267
matplotlib__matplotlib-24026
matplotlib/matplotlib
matplotlib/matplotlib
python
14c96b510ebeba40f573e512299b1976f35b620e
stackplot should not change Axes cycler Usecase: I am producing various types of plots (some use rectangle collections, some regular plot-lines, some stacked plots) and wish to keep the colors synchronized across plot types for consistency and ease of comparison. While `ax.plot()` and `matplotlib.patches.Rectangle()` ...
diff --git a/lib/matplotlib/stackplot.py b/lib/matplotlib/stackplot.py --- a/lib/matplotlib/stackplot.py +++ b/lib/matplotlib/stackplot.py @@ -6,6 +6,8 @@ (https://stackoverflow.com/users/66549/doug) """ +import itertools + import numpy as np from matplotlib import _api @@ -70,7 +72,9 @@ def stackplot(axes, x, ...
diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py @@ -2851,10 +2851,11 @@ def test_stackplot(): ax.set_xlim((0, 10)) ax.set_ylim((0, 70)) - # Reuse testcase from above for a labeled data test ...
["lib/matplotlib/tests/test_axes.py::test_stackplot[png]", "lib/matplotlib/tests/test_axes.py::test_stackplot[pdf]"]
["lib/matplotlib/tests/test_axes.py::test_invisible_axes[png]", "lib/matplotlib/tests/test_axes.py::test_get_labels", "lib/matplotlib/tests/test_axes.py::test_repr", "lib/matplotlib/tests/test_axes.py::test_label_loc_vertical[png]", "lib/matplotlib/tests/test_axes.py::test_label_loc_vertical[pdf]", "lib/matplotlib/test...
null
true
2022-09-28T02:45:01Z
1
13
2
2,087
0
1
1
1
1
0.391167
96.1735
14
swe_bench_verified::test::300
swe_bench_verified
test
300
pydata__xarray-3151
pydata/xarray
pydata/xarray
python
118f4d996e7711c9aced916e6049af9f28d5ec66
xr.combine_by_coords raises ValueError if identical coordinates are non-monotonic #### MCVE Code Sample ```python import xarray as xr import numpy as np #yCoord = ['a', 'b', 'c'] # works without error yCoord = ['a', 'c', 'b'] # raises ValueError on combine ds1 = xr.Dataset( data_vars=dict( data=(['x', ...
diff --git a/xarray/core/combine.py b/xarray/core/combine.py --- a/xarray/core/combine.py +++ b/xarray/core/combine.py @@ -501,14 +501,13 @@ def combine_by_coords(datasets, compat='no_conflicts', data_vars='all', fill_value=fill_value) # Check the overall coordinates are m...
diff --git a/xarray/tests/test_combine.py b/xarray/tests/test_combine.py --- a/xarray/tests/test_combine.py +++ b/xarray/tests/test_combine.py @@ -581,6 +581,25 @@ def test_infer_order_from_coords(self): expected = data assert expected.broadcast_equals(actual) + def test_combine_leaving_bystander...
["xarray/tests/test_combine.py::TestCombineAuto::test_combine_leaving_bystander_dimensions"]
["xarray/tests/test_combine.py::TestTileIDsFromNestedList::test_1d", "xarray/tests/test_combine.py::TestTileIDsFromNestedList::test_2d", "xarray/tests/test_combine.py::TestTileIDsFromNestedList::test_3d", "xarray/tests/test_combine.py::TestTileIDsFromNestedList::test_single_dataset", "xarray/tests/test_combine.py::Test...
null
true
2019-07-20T12:31:14Z
1
15
1
2,006
0
1
1
1
1
0.384333
96.153
15
swe_gym::train::1432
swe_gym
train
1,432
pandas-dev__pandas-51976
pandas-dev/pandas
pandas-dev/pandas
python
93b5135f7113309fbee37196460eab994b170195
BUG: "TypeError: Cannot interpret 'string[pyarrow]' as a data type" when reading csv with pyarrow dtypes ### Pandas version checks - [X] I have checked that this issue has not already been reported. - [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of ...
Here is a full stack trace for people's reference: ``` >>> pd.read_csv('flights.csv', usecols=[7,8], use_nullable_dtypes=True) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/zach/.local/lib/python3.11/site-packages/pandas/io/parsers/readers.py", line 918, in read_csv re...
diff --git a/pandas/io/parsers/c_parser_wrapper.py b/pandas/io/parsers/c_parser_wrapper.py index 4b8bc5c402157..3d3e343050421 100644 --- a/pandas/io/parsers/c_parser_wrapper.py +++ b/pandas/io/parsers/c_parser_wrapper.py @@ -23,8 +23,10 @@ is_categorical_dtype, pandas_dtype, ) -from pandas.core.dtypes.concat...
diff --git a/pandas/tests/io/parser/test_concatenate_chunks.py b/pandas/tests/io/parser/test_concatenate_chunks.py new file mode 100644 index 0000000000000..1bae2317a2fc6 --- /dev/null +++ b/pandas/tests/io/parser/test_concatenate_chunks.py @@ -0,0 +1,36 @@ +import numpy as np +import pytest + +from pandas.errors impor...
["pandas/tests/io/parser/test_concatenate_chunks.py::test_concatenate_chunks_pyarrow", "pandas/tests/io/parser/test_concatenate_chunks.py::test_concatenate_chunks_pyarrow_strings"]
[]
null
true
2023-03-15T01:12:14Z
1
39
2
2,835
0
0.85
1
1
1
0.6025
95.9575
16
swe_gym::train::1735
swe_gym
train
1,735
pandas-dev__pandas-48587
pandas-dev/pandas
pandas-dev/pandas
python
b5632fb310c26292ac37c64b6a514f50eff1d77d
BUG: 1.5rc raises TypeError when passing tuple to series.str.startswith() ### Pandas version checks - [X] I have checked that this issue has not already been reported. - [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas. - [X] I have confirmed ...
Label this as regression for now. Would argue that we should document and support handing tuples to `Series.str.startswith` since this behaviour is there at least from Dec 2020 (see issue #38281) on. I think it should also count as a regression for the reason that the docs claim it's equivalent to `str.startswith()` wh...
diff --git a/pandas/core/strings/accessor.py b/pandas/core/strings/accessor.py index f9852005314a4..46628eb3e17dd 100644 --- a/pandas/core/strings/accessor.py +++ b/pandas/core/strings/accessor.py @@ -19,6 +19,7 @@ from pandas._typing import ( DtypeObj, F, + Scalar, ) from pandas.util._decorators import...
diff --git a/pandas/tests/strings/test_find_replace.py b/pandas/tests/strings/test_find_replace.py index 1c74950e30c40..62f9478bf25ff 100644 --- a/pandas/tests/strings/test_find_replace.py +++ b/pandas/tests/strings/test_find_replace.py @@ -291,21 +291,22 @@ def test_contains_nan(any_string_dtype): # -----------------...
["pandas/tests/strings/test_find_replace.py::test_startswith[False-null_value2-category-pat1]", "pandas/tests/strings/test_find_replace.py::test_endswith[True-null_value2-None-pat1]", "pandas/tests/strings/test_find_replace.py::test_startswith[False-null_value2-None-pat1]", "pandas/tests/strings/test_find_replace.py::t...
["pandas/tests/strings/test_find_replace.py::test_replace_compiled_regex_callable[string[python]]", "pandas/tests/strings/test_strings.py::test_index[index-object-index-EF-None-None-expected0]", "pandas/tests/strings/test_strings.py::test_index_str_accessor_visibility[series-values3-mixed-integer]", "pandas/tests/strin...
null
true
2022-09-16T17:57:31Z
1
41
27
2,764
0
0.85
1
1
1
0.597333
95.942
17
swe_gym::train::1681
swe_gym
train
1,681
pandas-dev__pandas-54226
pandas-dev/pandas
pandas-dev/pandas
python
af76d785ccae9383f5cf9b73e0bce79aa8ae8326
BUG: pd.Series idxmax raises ValueError instead of returning <NA> when all values are <NA> ### Pandas version checks - [X] I have checked that this issue has not already been reported. - [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas. - [ ] ...
Thanks for the report! Confirmed on main; further investigations and PRs to fix are welcome. Discussed in in last week's dev call, agreed that raising is the preferred eventual behavior, need a deprecation cycle to get consistent behavior across dtypes.
diff --git a/doc/source/whatsnew/v2.1.0.rst b/doc/source/whatsnew/v2.1.0.rst index ed8646bafc4db..18c76dd3cca08 100644 --- a/doc/source/whatsnew/v2.1.0.rst +++ b/doc/source/whatsnew/v2.1.0.rst @@ -309,6 +309,7 @@ Deprecations - Deprecated ``axis=1`` in :meth:`DataFrame.ewm`, :meth:`DataFrame.rolling`, :meth:`DataFrame...
diff --git a/pandas/conftest.py b/pandas/conftest.py index d7e8fbeb9336b..45fe755568d76 100644 --- a/pandas/conftest.py +++ b/pandas/conftest.py @@ -142,6 +142,10 @@ def pytest_collection_modifyitems(items, config) -> None: ("is_sparse", "is_sparse is deprecated"), ("NDFrame.replace", "The 'method' ke...
["pandas/tests/reductions/test_reductions.py::TestSeriesReductions::test_idxmin", "pandas/tests/reductions/test_reductions.py::TestSeriesReductions::test_idxmin_dt64index", "pandas/tests/frame/test_reductions.py::TestDataFrameAnalytics::test_idxmax[1-False]", "pandas/tests/frame/test_reductions.py::TestDataFrameAnalyti...
["pandas/tests/reductions/test_reductions.py::TestSeriesMode::test_multimode_complex[array1-expected1-complex64]", "pandas/tests/frame/test_reductions.py::TestDataFrameAnalytics::test_stat_operators_attempt_obj_array[axis='index'-df1-prod]", "pandas/tests/reductions/test_reductions.py::TestSeriesMode::test_mode_numeric...
null
true
2023-07-22T02:29:07Z
3
35
12
2,782
0
0.85
1
1
1
0.580333
95.891
18
swe_gym::train::1880
swe_gym
train
1,880
facebookresearch__hydra-1372
facebookresearch/hydra
facebookresearch/hydra
python
d9990c5ecc1feb1a0d08a525503400b269ee2917
Confusing error message when overriding hydra/launcher from a nested defaults list without absolute and global package # 🐛 Bug ## Description I have a config file which, among other things, is supposed to turn on the "submitit_slurm" launcher. This is not the "main" config for the python file, it's another config whi...
> but I'm not trying to override hydra/launcher I'm trying to add it so I think it should work and changing the config to override hydra/launcher: submitit_slurm throws the same error. See minimal repro. You can't add it because Hydra is adding it automatically. You need to override it. To make it easier to help...
diff --git a/hydra/_internal/defaults_list.py b/hydra/_internal/defaults_list.py --- a/hydra/_internal/defaults_list.py +++ b/hydra/_internal/defaults_list.py @@ -126,30 +126,25 @@ def override_default_option(self, default: GroupDefault) -> None: def ensure_overrides_used(self) -> None: for key, meta in s...
diff --git a/tests/defaults_list/data/experiment/error_override_without_abs_and_header.yaml b/tests/defaults_list/data/experiment/error_override_without_abs_and_header.yaml new file mode 100644 --- /dev/null +++ b/tests/defaults_list/data/experiment/error_override_without_abs_and_header.yaml @@ -0,0 +1,2 @@ +defaults: ...
["tests/defaults_list/test_defaults_tree.py::test_experiment_overriding_global_group[include_absolute_config:override_with_global_default]", "tests/defaults_list/test_defaults_list.py::test_include_nested_group_global[option_override:include_nested_config_item_global]", "tests/defaults_list/test_defaults_tree.py::test_...
["tests/defaults_list/test_defaults_tree.py::test_deprecated_package_header_keywords[deprecated_headers/group_foo]", "tests/defaults_list/test_defaults_list.py::test_set_package_header_with_parent_pkg[gd:_group_]", "tests/defaults_list/test_defaults_tree.py::test_interpolation[interpolation_with_nested_defaults_list_wi...
null
true
2021-02-02T02:02:54Z
2
25
6
2,917
0
0.85
1
1
1
0.5695
95.8585
19
swe_gym::train::69
swe_gym
train
69
getmoto__moto-5767
getmoto/moto
getmoto/moto
python
3c7bdcc5ea4d30681c5d8712926adedc294948fe
[dynamodb] Incorrect handling of array indices when removing multiple items from a list attribute ## [dynamodb] Incorrect handling of array indices when removing multiple items from a list attribute We have noticed an issue with the dynamodb mock implementation related to update-queries with a remove-expression, in pa...
Thanks for raising this and providing the repro, @JonathanRohland-TNG! Marking it as a bug.
diff --git a/moto/dynamodb/models/__init__.py b/moto/dynamodb/models/__init__.py --- a/moto/dynamodb/models/__init__.py +++ b/moto/dynamodb/models/__init__.py @@ -1588,6 +1588,7 @@ def update_item( table=table, ) validated_ast = validator.validate() + validated_ast....
diff --git a/tests/test_dynamodb/test_dynamodb.py b/tests/test_dynamodb/test_dynamodb.py --- a/tests/test_dynamodb/test_dynamodb.py +++ b/tests/test_dynamodb/test_dynamodb.py @@ -2721,6 +2721,29 @@ def test_remove_list_index__remove_existing_index(): result["itemlist"].should.equal({"L": [{"S": "bar1"}, {"S": "bar...
["tests/test_dynamodb/test_dynamodb_executor.py::test_normalize_with_one_action", "tests/test_dynamodb/test_dynamodb_executor.py::test_normalize_with_multiple_actions__order_is_preserved", "tests/test_dynamodb/test_dynamodb.py::test_remove_list_index__remove_multiple_indexes"]
["tests/test_dynamodb/test_dynamodb_executor.py::test_execution_of_if_not_exists_not_existing_value", "tests/test_dynamodb/test_dynamodb.py::test_remove_list_index__remove_existing_nested_index", "tests/test_dynamodb/test_dynamodb.py::test_basic_projection_expressions_using_query_with_attr_expression_names", "tests/tes...
null
true
2022-12-13 21:31:54
3
63
3
2,147
0
0.85
1
1
1
0.567833
95.8535
20
swe_gym::train::1601
swe_gym
train
1,601
pandas-dev__pandas-56370
pandas-dev/pandas
pandas-dev/pandas
python
0d8a0f3ac7b5b841fb9b38dad17e6a91f0c48afc
BUG: rolling does not work with timestamp[ns][pyarrow] index type ### Pandas version checks - [X] I have checked that this issue has not already been reported. - [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas. - [ ] I have confirmed this bug...
@mhabets Rolling function is having window of datatype integer If you give string it will throw error as it is expected So Kindly give window =5 and it will work @mhabets in rolling.py kindly find the validation if not is_integer(self.window) or self.window < 0: raise ValueError("window must ...
diff --git a/doc/source/whatsnew/v2.2.0.rst b/doc/source/whatsnew/v2.2.0.rst index d1481639ca5a0..58a70a2b66a84 100644 --- a/doc/source/whatsnew/v2.2.0.rst +++ b/doc/source/whatsnew/v2.2.0.rst @@ -831,6 +831,7 @@ Groupby/resample/rolling - Bug in :meth:`DataFrame.resample` when resampling on a :class:`ArrowDtype` of `...
diff --git a/pandas/tests/window/test_timeseries_window.py b/pandas/tests/window/test_timeseries_window.py index c99fc8a8eb60f..bd0fadeb3e475 100644 --- a/pandas/tests/window/test_timeseries_window.py +++ b/pandas/tests/window/test_timeseries_window.py @@ -1,9 +1,12 @@ import numpy as np import pytest +import panda...
["pandas/tests/window/test_timeseries_window.py::test_arrow_datetime_axis"]
["pandas/tests/window/test_timeseries_window.py::TestRollingTS::test_all2[skew]", "pandas/tests/window/test_timeseries_window.py::TestRollingTS::test_all[mean]", "pandas/tests/window/test_timeseries_window.py::TestRollingTS::test_invalid_minp[foo]", "pandas/tests/window/test_timeseries_window.py::TestRollingTS::test_fr...
null
true
2023-12-06T21:55:41Z
3
31
1
2,783
0
0.85
1
1
1
0.567167
95.8515
21
swe_gym::train::119
swe_gym
train
119
getmoto__moto-6127
getmoto/moto
getmoto/moto
python
5c2fc55ea1d2975d5be50dead4f9b49d76feec8b
Secrets Manager backend does not support partial ARNs The `moto` secrets manager backend is unable to retrieve secrets when a partial ARN is passed as secret ID. **How to reproduce the issue** Here is a minimal example that demonstrates the issue: ```python import boto3 import pytest from moto import mock_secretsmanag...
From the docs (https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/secretsmanager.html#SecretsManager.Client.create_secret): ``` Do not end your secret name with a hyphen followed by six characters. If you do so, you risk confusion and unexpected results when searching for a secret by partial ...
diff --git a/moto/secretsmanager/models.py b/moto/secretsmanager/models.py --- a/moto/secretsmanager/models.py +++ b/moto/secretsmanager/models.py @@ -16,7 +16,7 @@ InvalidRequestException, ClientError, ) -from .utils import random_password, secret_arn, get_secret_name_from_arn +from .utils import random_pas...
diff --git a/tests/test_secretsmanager/test_secretsmanager.py b/tests/test_secretsmanager/test_secretsmanager.py --- a/tests/test_secretsmanager/test_secretsmanager.py +++ b/tests/test_secretsmanager/test_secretsmanager.py @@ -547,17 +547,26 @@ def test_describe_secret(): @mock_secretsmanager -def test_describe_se...
["tests/test_secretsmanager/test_secretsmanager.py::test_describe_secret_with_arn[test-secret]", "tests/test_secretsmanager/test_secretsmanager.py::test_describe_secret_with_arn[testsecret]"]
["tests/test_secretsmanager/test_secretsmanager.py::test_get_secret_that_has_no_value", "tests/test_secretsmanager/test_secretsmanager.py::test_get_secret_value_by_arn", "tests/test_secretsmanager/test_secretsmanager.py::test_update_secret_with_KmsKeyId", "tests/test_secretsmanager/test_secretsmanager.py::test_get_secr...
null
true
2023-03-24 23:01:32
2
58
2
2,070
0
0.85
1
1
1
0.538333
95.765
22
swe_gym::train::1433
swe_gym
train
1,433
pandas-dev__pandas-48696
pandas-dev/pandas
pandas-dev/pandas
python
71fc89cd515c3c19230fbab64e979118858b808a
BUG: to_hdf fails with boolean index in 1.5 ### Pandas version checks - [X] I have checked that this issue has not already been reported. - [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas. - [X] I have confirmed this bug exists on the main br...
Seems to be a change from the dtype of the index 1.5 behavior In [12]: pd.DataFrame([[True, 1]], columns=["a", "b"]).set_index("a").index Out[12]: Index([True], dtype='bool', name='a') 1.4 behavior In [11]: pd.DataFrame([[True, 1]], columns=["a", "b"]).set_index("a").index Out[11]: Index([True], dtype='objec...
diff --git a/doc/source/whatsnew/v1.5.1.rst b/doc/source/whatsnew/v1.5.1.rst index 9d40d9118db32..0d5f7cf81de69 100644 --- a/doc/source/whatsnew/v1.5.1.rst +++ b/doc/source/whatsnew/v1.5.1.rst @@ -23,7 +23,7 @@ Fixed regressions Bug fixes ~~~~~~~~~ -- +- Bug in :meth:`DataFrame.to_hdf` raising ``AssertionError`` wi...
diff --git a/pandas/tests/io/pytables/test_store.py b/pandas/tests/io/pytables/test_store.py index e8f4e7ee92fc3..db87c8facbfdb 100644 --- a/pandas/tests/io/pytables/test_store.py +++ b/pandas/tests/io/pytables/test_store.py @@ -1026,3 +1026,16 @@ def test_hdfstore_strides(setup_path): with ensure_clean_store(setu...
["pandas/tests/io/pytables/test_store.py::test_store_bool_index"]
["pandas/tests/io/pytables/test_store.py::test_to_hdf_with_object_column_names", "pandas/tests/io/pytables/test_store.py::test_create_table_index", "pandas/tests/io/pytables/test_store.py::test_no_track_times", "pandas/tests/io/pytables/test_store.py::test_coordinates", "pandas/tests/io/pytables/test_store.py::test_sel...
null
true
2022-09-21T21:54:02Z
2
11
1
2,996
0
0.85
1
1
1
0.536
95.758
23
swe_gym::train::1177
swe_gym
train
1,177
pandas-dev__pandas-53044
pandas-dev/pandas
pandas-dev/pandas
python
721bd7a22efbd1c57f86fd61d6f0e668b79942ae
BUG: AttributeError: 'tuple' object has no attribute 'rstrip' in format_object_summary ### Pandas version checks - [X] I have checked that this issue has not already been reported. - [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas. - [ ] I ha...
likely caused by https://github.com/pandas-dev/pandas/pull/49740 where the ```py head = [_pprint_seq(x, max_seq_items=max_items) for x in head] tail = [_pprint_seq(x, max_seq_items=max_items) for x in tail] ``` block was moved from outside the for loop to the inside take
diff --git a/doc/source/whatsnew/v2.1.0.rst b/doc/source/whatsnew/v2.1.0.rst index 84e011bf80da6..c390f57a904cb 100644 --- a/doc/source/whatsnew/v2.1.0.rst +++ b/doc/source/whatsnew/v2.1.0.rst @@ -372,7 +372,7 @@ I/O - Bug in :func:`read_hdf` not properly closing store after a ``IndexError`` is raised (:issue:`52781`)...
diff --git a/pandas/tests/io/formats/test_printing.py b/pandas/tests/io/formats/test_printing.py index 803ed8d342a2f..6f578b45bf71d 100644 --- a/pandas/tests/io/formats/test_printing.py +++ b/pandas/tests/io/formats/test_printing.py @@ -196,3 +196,14 @@ def test_enable_data_resource_formatter(self, ip): as...
["pandas/tests/io/formats/test_printing.py::test_multiindex_long_element"]
["pandas/tests/io/formats/test_printing.py::TestTableSchemaRepr::test_publishes_not_implemented", "pandas/tests/io/formats/test_printing.py::TestFormattBase::test_east_asian_len", "pandas/tests/io/formats/test_printing.py::TestTableSchemaRepr::test_enable_data_resource_formatter", "pandas/tests/io/formats/test_printing...
null
true
2023-05-02T20:31:03Z
2
12
1
2,951
0
0.85
1
1
1
0.531833
95.7455
24
swe_gym::train::1613
swe_gym
train
1,613
pandas-dev__pandas-55586
pandas-dev/pandas
pandas-dev/pandas
python
6f950c1c36eecce7aad3527b20da25943ebb028d
BUG: TypeError: GroupBy.first() got an unexpected keyword argument 'engine' ### Pandas version checks - [X] I have checked that this issue has not already been reported. - [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas. - [ ] I have confirme...
also happens to `last` method. I confirm this bug exists on main branch of pandas. cc @lithomas1 - if numba is not explicitly requested by passing engine, I think we need to check whether the given method has a numba implementation. Haven't checked yet - but I'm pretty certain this is a regression.
diff --git a/doc/source/whatsnew/v2.1.2.rst b/doc/source/whatsnew/v2.1.2.rst index 7c04d1a03a6e4..9d2826395b0ef 100644 --- a/doc/source/whatsnew/v2.1.2.rst +++ b/doc/source/whatsnew/v2.1.2.rst @@ -16,6 +16,7 @@ Fixed regressions - Fixed regression in :meth:`DataFrame.join` where result has missing values and dtype is ...
diff --git a/pandas/tests/groupby/test_numba.py b/pandas/tests/groupby/test_numba.py index e36c248c99ad6..ee7d342472493 100644 --- a/pandas/tests/groupby/test_numba.py +++ b/pandas/tests/groupby/test_numba.py @@ -3,6 +3,7 @@ from pandas import ( DataFrame, Series, + option_context, ) import pandas._test...
["pandas/tests/groupby/test_numba.py::TestEngine::test_no_engine_doesnt_raise"]
["pandas/tests/groupby/test_numba.py::TestEngine::test_axis_1_unsupported[sum-min_count]", "pandas/tests/groupby/test_numba.py::TestEngine::test_cython_vs_numba_getitem[False-False-True-True-max-min_count]", "pandas/tests/groupby/test_numba.py::TestEngine::test_cython_vs_numba_frame[False-False-False-True-min]", "panda...
null
true
2023-10-19T02:27:14Z
2
8
1
2,994
0
0.85
1
1
1
0.525667
95.727
25
swe_gym::train::1315
swe_gym
train
1,315
pandas-dev__pandas-48058
pandas-dev/pandas
pandas-dev/pandas
python
70f981fbf2aecdbae85deddbec3ee473994f30b9
BUG: Reset index regression ### Pandas version checks - [X] I have checked that this issue has not already been reported. - [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas. - [X] I have confirmed this bug exists on the main branch of pandas. ...
Looks like this was caused as a result of #43933 682187225059cbf8e93df04042ee04bf498d6cc4 is the first bad commit commit 682187225059cbf8e93df04042ee04bf498d6cc4 Author: jbrockmendel <jbrockmendel@gmail.com> Date: Fri Oct 8 17:17:40 2021 -0700 BUG: NumericIndex.insert (#43933) pandas/core/indexes/bas...
diff --git a/doc/source/whatsnew/v1.4.4.rst b/doc/source/whatsnew/v1.4.4.rst index 25db2ef7253d9..b09d14010545c 100644 --- a/doc/source/whatsnew/v1.4.4.rst +++ b/doc/source/whatsnew/v1.4.4.rst @@ -22,6 +22,7 @@ Fixed regressions - Fixed regression in :meth:`DataFrame.loc` not aligning index in some cases when setting ...
diff --git a/pandas/tests/indexes/test_subclass.py b/pandas/tests/indexes/test_subclass.py new file mode 100644 index 0000000000000..2ddf3baabbec0 --- /dev/null +++ b/pandas/tests/indexes/test_subclass.py @@ -0,0 +1,38 @@ +""" +Tests involving custom Index subclasses +""" +import numpy as np + +from pandas import ( + ...
["pandas/tests/indexes/test_subclass.py::test_insert_fallback_to_base_index"]
[]
null
true
2022-08-12T14:41:46Z
2
11
1
2,704
0
0.85
1
1
1
0.487333
95.612
26
swe_gym::train::168
swe_gym
train
168
getmoto__moto-4793
getmoto/moto
getmoto/moto
python
05f5bbc568b3e1b9de402d194b3e93a39b6b2c27
s3 get_object to return TagCount # Summary The `get_object()` function in boto with the real S3 returns `TagCount` if there are any tags on the object. With moto, `TagCount` is never returned, but should be. # Steps to reproduce Try this with `if True` to use moto, and `if False` to not use moto. ``` import urllib....
Thanks for raising this @mdavis-xyz - marking it as an enhancement to add this field.
diff --git a/moto/s3/models.py b/moto/s3/models.py --- a/moto/s3/models.py +++ b/moto/s3/models.py @@ -115,6 +115,7 @@ def __init__( lock_mode=None, lock_legal_status=None, lock_until=None, + s3_backend=None, ): self.name = name self.last_modified = datetime.date...
diff --git a/tests/terraform-tests.success.txt b/tests/terraform-tests.success.txt --- a/tests/terraform-tests.success.txt +++ b/tests/terraform-tests.success.txt @@ -121,6 +121,7 @@ TestAccAWSENI_basic TestAccAWSENI_IPv6 TestAccAWSENI_disappears TestAccAWSS3BucketObject_ +TestAccAWSS3ObjectCopy TestAccAWSIAMPolicy...
["tests/test_s3/test_s3.py::test_boto3_put_object_with_tagging", "tests/test_s3/test_s3.py::test_copy_object_with_bucketkeyenabled_returns_the_value"]
["tests/test_s3/test_s3.py::test_s3_abort_multipart_data_with_invalid_upload_and_key", "tests/test_s3/test_s3.py::test_put_bucket_notification", "tests/test_s3/test_s3.py::test_create_bucket_duplicate", "tests/test_s3/test_s3.py::test_boto3_list_object_versions_with_versioning_disabled", "tests/test_s3/test_s3.py::test...
null
true
2022-01-25 17:35:57
2
68
2
1,522
0
0.85
1
1
1
0.480333
95.591
27
swe_gym::train::1829
swe_gym
train
1,829
pandas-dev__pandas-47623
pandas-dev/pandas
pandas-dev/pandas
python
b4ec0207366f5b497b382bd4c20566ef9111776a
BUG: Unexpected IndexingError when filtering with .loc ### Pandas version checks - [X] I have checked that this issue has not already been reported. - [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas. - [X] I have confirmed this bug exists on ...
@bikoboshi To me this behavior makes perfect sense if one accepts that an empty Series can be indexed arbitrarily! Indexing in general is not commutative: ``` s[b] # Series([], dtype: int64) empty Series s[b][a] #legal s[a] #0 1 #dtype: int64 # not empty s[a][b] #raises since mismatching dimensions ...
diff --git a/doc/source/whatsnew/v1.5.0.rst b/doc/source/whatsnew/v1.5.0.rst index 0b450fab53137..62a99ce3cae44 100644 --- a/doc/source/whatsnew/v1.5.0.rst +++ b/doc/source/whatsnew/v1.5.0.rst @@ -885,6 +885,7 @@ Indexing - Bug when setting a value too large for a :class:`Series` dtype failing to coerce to a common ty...
diff --git a/pandas/tests/series/indexing/test_indexing.py b/pandas/tests/series/indexing/test_indexing.py index 3a8e14576a55d..2f4fffe57593f 100644 --- a/pandas/tests/series/indexing/test_indexing.py +++ b/pandas/tests/series/indexing/test_indexing.py @@ -5,7 +5,10 @@ import numpy as np import pytest +from pandas....
["pandas/tests/series/indexing/test_indexing.py::test_loc_boolean_indexer_non_matching_index"]
["pandas/tests/series/indexing/test_indexing.py::TestDeprecatedIndexers::test_setitem_dict_and_set_deprecated_multiindex[key3]", "pandas/tests/series/indexing/test_indexing.py::TestDeprecatedIndexers::test_getitem_dict_and_set_deprecated_multiindex[key2]", "pandas/tests/series/indexing/test_indexing.py::test_getitem_du...
null
true
2022-07-07T11:47:26Z
2
15
1
2,567
0
0.85
1
1
1
0.477833
95.5835
28
swe_gym::train::358
swe_gym
train
358
python__mypy-14988
python/mypy
python/mypy
python
c0af000d068b30362c4f4f72b8823e4f3f5b3e08
mypyc: `Cls.__dict__` is `mappingproxy`, not `dict` **Bug Report** It looks mypy's type inference works fine and it's mypyc (maybe) bug Maybe it's connected to builtins `vars` signature -- vars by the signature should return `dict` But it's false, `vars` may return `mappingproxy`: ``` >>> class Foo: ... >>> Foo.__dict...
Currently [the stub for `vars()` in typeshed](https://github.com/python/typeshed/blob/7b3fff714a48f0413141ba10344f9473e3ec4a18/stdlib/builtins.pyi#L1671) is this: ```python def vars(__object: Any = ...) -> dict[str, Any]: ... ``` Maybe it should be this: ```python def vars(__object: Any = ...) -> Mapping[st...
diff --git a/mypy/checkmember.py b/mypy/checkmember.py --- a/mypy/checkmember.py +++ b/mypy/checkmember.py @@ -388,7 +388,7 @@ def analyze_type_callable_member_access(name: str, typ: FunctionLike, mx: Member # See https://github.com/python/mypy/pull/1787 for more info. # TODO: do not rely on s...
diff --git a/test-data/unit/check-class-namedtuple.test b/test-data/unit/check-class-namedtuple.test --- a/test-data/unit/check-class-namedtuple.test +++ b/test-data/unit/check-class-namedtuple.test @@ -325,7 +325,10 @@ class X(NamedTuple): reveal_type(X._fields) # N: Revealed type is "Tuple[builtins.str, builtins.st...
["mypy/test/testpythoneval.py::PythonEvaluationSuite::pythoneval.test::testInferenceOfDunderDictOnClassObjects", "mypy/test/testcheck.py::TypeCheckSuite::check-classes.test::testMetaclassConflictingInstanceVars"]
["mypy/test/testpythoneval.py::PythonEvaluationSuite::pythoneval.test::testTypeVarTupleTypingExtensions", "mypy/test/testcheck.py::TypeCheckSuite::check-typevar-tuple.test::testTypeVarTupleGenericClassWithFunctions", "mypy/test/testcheck.py::TypeCheckSuite::check-typevar-tuple.test::testTypeVarTuplePep646TypeVarStarArg...
null
true
2023-03-31T14:29:58Z
1
30
2
2,217
0
0.85
1
1
1
0.4695
95.5585
29
swe_gym::train::1331
swe_gym
train
1,331
pandas-dev__pandas-51191
pandas-dev/pandas
pandas-dev/pandas
python
808e56eb2a60685ba167bb2c523e8f844652f46b
BUG: Differences in setting value error between string dtype and others ### Pandas version checks - [X] I have checked that this issue has not already been reported. - [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas. - [ ] I have confirmed th...
Agreed, this should be consistent I think
diff --git a/doc/source/whatsnew/v2.0.0.rst b/doc/source/whatsnew/v2.0.0.rst index ef6bb1340dc69..64f21e027e048 100644 --- a/doc/source/whatsnew/v2.0.0.rst +++ b/doc/source/whatsnew/v2.0.0.rst @@ -1324,6 +1324,7 @@ ExtensionArray - Bug in :meth:`api.types.is_numeric_dtype` where a custom :class:`ExtensionDtype` would ...
diff --git a/pandas/tests/arrays/string_/test_string.py b/pandas/tests/arrays/string_/test_string.py index da5fc46c03d92..cced9cfe8cb20 100644 --- a/pandas/tests/arrays/string_/test_string.py +++ b/pandas/tests/arrays/string_/test_string.py @@ -53,14 +53,14 @@ def test_setitem_validates(cls): msg = "Cannot set...
["pandas/tests/arrays/string_/test_string.py::test_setitem_scalar_with_mask_validation[pyarrow]", "pandas/tests/arrays/string_/test_string.py::test_setitem_validates[python]", "pandas/tests/arrays/string_/test_string.py::test_setitem_scalar_with_mask_validation[python]", "pandas/tests/arrays/string_/test_string.py::tes...
["pandas/tests/arrays/string_/test_string.py::test_tolist[python]", "pandas/tests/arrays/string_/test_string.py::test_from_numpy_str[pyarrow]", "pandas/tests/arrays/string_/test_string.py::test_comparison_methods_array[le-pyarrow]", "pandas/tests/arrays/string_/test_string.py::test_from_sequence_no_mutate[python-False]...
null
true
2023-02-06T08:03:24Z
3
9
5
2,554
0
0.85
1
1
1
0.455667
95.517
30
swe_gym::train::1595
swe_gym
train
1,595
pandas-dev__pandas-47547
pandas-dev/pandas
pandas-dev/pandas
python
901b02f67c426872d75b5ba3e2eb5e42732a6c67
BUG: NotImplementedError: Prefix not defined when slicing offset with loc ### Pandas version checks - [X] I have checked that this issue has not already been reported. - [x] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas. - [ ] I have confirmed ...
Thanks @WillianFuks for the report. > As it seems, starting from version 1.4 onward, if the date index is of type `offset` then when trying to run `loc` operations raises `NotImplementedError: Prefix not defined`. first bad commit: [9a5da9b64c65a8a082bd4cd26c69bd420fb9a408] REF: share _get_string_slice (#42149) ...
diff --git a/doc/source/whatsnew/v1.4.4.rst b/doc/source/whatsnew/v1.4.4.rst index 927841d42b543..05ebe424a8ea9 100644 --- a/doc/source/whatsnew/v1.4.4.rst +++ b/doc/source/whatsnew/v1.4.4.rst @@ -22,6 +22,7 @@ Fixed regressions - Fixed regression in :meth:`DataFrame.loc` not updating the cache correctly after values ...
diff --git a/pandas/tests/frame/indexing/test_getitem.py b/pandas/tests/frame/indexing/test_getitem.py index a98fa52e1009d..f5c85bd98d8ad 100644 --- a/pandas/tests/frame/indexing/test_getitem.py +++ b/pandas/tests/frame/indexing/test_getitem.py @@ -8,12 +8,14 @@ CategoricalDtype, CategoricalIndex, DataFr...
["pandas/tests/frame/indexing/test_getitem.py::TestGetitemListLike::test_getitem_iloc_dateoffset_days"]
["pandas/tests/frame/indexing/test_getitem.py::TestGetitemListLike::test_getitem_listlike[1-dict_keys]", "pandas/tests/frame/indexing/test_getitem.py::TestGetitemBooleanMask::test_getitem_returns_view_when_column_is_unique_in_df", "pandas/tests/frame/indexing/test_getitem.py::TestGetitemListLike::test_getitem_listlike[...
null
true
2022-06-29T09:09:29Z
2
8
1
2,565
0
0.85
1
1
1
0.454167
95.5125
31
swe_gym::train::1925
swe_gym
train
1,925
facebookresearch__hydra-1488
facebookresearch/hydra
facebookresearch/hydra
python
d217c86b9061bb502d00fa971b3ea15a70e3299b
[Bug] [configen] configen fails on modules with `from __future__ import annotations` (default in python 3.10) # 🐛 Bug ## Description This is the same issue as in omry/omegaconf#303 for which I provided a fix in omry/omegaconf#424. The behavior that will become default in python 3.10, and which can be activated since p...
Thanks @thomkeh, PR welcome :)
diff --git a/tools/configen/configen/configen.py b/tools/configen/configen/configen.py --- a/tools/configen/configen/configen.py +++ b/tools/configen/configen/configen.py @@ -9,7 +9,7 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved from textwrap import dedent -from typing import Any, Dict,...
diff --git a/tools/configen/tests/test_generate.py b/tools/configen/tests/test_generate.py --- a/tools/configen/tests/test_generate.py +++ b/tools/configen/tests/test_generate.py @@ -1,4 +1,5 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +import sys from textwrap import dedent from diff...
["tools/configen/tests/test_generate.py::test_generated_code_future_ann"]
["tools/configen/tests/test_generate.py::test_instantiate_classes[DictValues]", "tools/configen/tests/test_generate.py::test_instantiate_classes[Tuples]", "tools/configen/tests/test_generate.py::test_generated_code", "tools/configen/tests/test_generate.py::test_generated_code_with_default_flags[noflags]", "tools/config...
null
true
2021-03-23T23:08:38Z
1
7
1
2,563
0
0.85
1
1
1
0.4505
95.5015
32
swe_gym::train::1072
swe_gym
train
1,072
pydantic__pydantic-8316
pydantic/pydantic
pydantic/pydantic
python
20c0c6d9219e29a95f5e1cadeb05ec39d8c15c24
`to_snake` alias generator bug -- great first issue ### Initial Checks - [X] I confirm that I'm using Pydantic V2 ### Description ### Issue Summary: When using the to_snake alias generator from pydantic.alias_generators in Pydantic v2, it appears that CamelCase strings are converted to lowercase without the inclusio...
@jevins09, Thanks for reporting this. I'd agree, we have a bug in our `to_snake` logic. This should be a one-liner fix in the definition of `to_snake`, so it's an awesome first issue if you're interested. In the second case, I don't think that the camel case alias generator is doing anything wrong. You wouldn't w...
diff --git a/pydantic/alias_generators.py b/pydantic/alias_generators.py --- a/pydantic/alias_generators.py +++ b/pydantic/alias_generators.py @@ -39,6 +39,12 @@ def to_snake(camel: str) -> str: Returns: The converted string in snake_case. """ - snake = re.sub(r'([a-zA-Z])([0-9])', lambda m: f'{m....
diff --git a/tests/test_utils.py b/tests/test_utils.py --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -529,6 +529,7 @@ def test_snake2camel(value: str, result: str) -> None: ('Camel2Snake', 'camel_2_snake'), ('_CamelToSnake', '_camel_to_snake'), ('CamelToSnake_', 'camel_to_snake_'), +...
["tests/test_utils.py::test_camel2snake[CAMELToSnake-camel_to_snake]"]
["tests/test_utils.py::test_value_items_merge[base9-override9-False-expected9]", "tests/test_utils.py::test_all_literal_values", "tests/test_utils.py::test_display_as_type[value14-LoggedVar]", "tests/test_utils.py::test_unique_list[input_value1-output1]", "tests/test_utils.py::test_snake2camel_start_lower[snake_to_came...
null
true
2023-12-07T04:05:58Z
1
10
1
2,453
0
0.85
1
1
1
0.442167
95.4765
33
swe_gym::train::1794
swe_gym
train
1,794
pandas-dev__pandas-48820
pandas-dev/pandas
pandas-dev/pandas
python
070e1fe860495e408c049155d1928f8f7b970408
BUG: `pd.to_datetime()` fails to parse nanoseconds ### Pandas version checks - [X] I have checked that this issue has not already been reported. - [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas. - [X] I have confirmed this bug exists on the ...
Thanks for the report @gtopper - [from git bisect](https://www.kaggle.com/code/marcogorelli/pandas-regression-example?scriptVersionId=106475285), this was due to https://github.com/pandas-dev/pandas/pull/46736 cc @jbrockmendel We should also add test coverage for this. Weird that we missed it. Incidentally just rearr...
diff --git a/doc/source/whatsnew/v1.5.1.rst b/doc/source/whatsnew/v1.5.1.rst index ee66f2f649bc2..a8ec836ba93df 100644 --- a/doc/source/whatsnew/v1.5.1.rst +++ b/doc/source/whatsnew/v1.5.1.rst @@ -76,6 +76,7 @@ Fixed regressions - Fixed regression in :meth:`DataFrame.plot` ignoring invalid ``colormap`` for ``kind="sca...
diff --git a/pandas/tests/tools/test_to_datetime.py b/pandas/tests/tools/test_to_datetime.py index 7e698b7a6b83d..9f7b1433b61bb 100644 --- a/pandas/tests/tools/test_to_datetime.py +++ b/pandas/tests/tools/test_to_datetime.py @@ -2815,3 +2815,21 @@ def test_to_datetime_cache_coerce_50_lines_outofbounds(series_length): ...
["pandas/tests/tools/test_to_datetime.py::test_to_datetime_format_f_parse_nanos"]
["pandas/tests/tools/test_to_datetime.py::TestDatetimeParsingWrappers::test_parsers_timezone_minute_offsets_roundtrip[False-2013-01-01", "pandas/tests/tools/test_to_datetime.py::TestDatetimeParsingWrappers::test_parsers[True-2005/11/09", "pandas/tests/tools/test_to_datetime.py::TestToDatetimeMisc::test_to_datetime_iso8...
null
true
2022-09-27T23:27:01Z
2
6
1
2,526
0
0.85
1
1
1
0.441
95.473
34
swe_gym::train::1054
swe_gym
train
1,054
pydantic__pydantic-8066
pydantic/pydantic
pydantic/pydantic
python
5ad928dae1de1eaec9576776838d76cc0abcd9f0
type casting does not work with multiple attributes of the same custom type ### Initial Checks - [X] I confirm that I'm using Pydantic V2 ### Description I tried to upgrade a custom data type from pydantic v1 to v2. It looks like the type casting works as long as there is only one attribute of the type assigned to ...
Also experiencing this issue, very similar use case to the example shown above. This definitely seems to me like a bug with the schema generation, though I'll note that I'm not surprised to see issues coming from overriding `BaseModel.__get_pydantic_core_schema__`. I suspect that there are some assumptions somewhere ab...
diff --git a/pydantic/_internal/_generate_schema.py b/pydantic/_internal/_generate_schema.py --- a/pydantic/_internal/_generate_schema.py +++ b/pydantic/_internal/_generate_schema.py @@ -52,6 +52,7 @@ define_expected_missing_refs, get_ref, get_type_ref, + is_function_with_inner_schema, is_list_li...
diff --git a/tests/test_json_schema.py b/tests/test_json_schema.py --- a/tests/test_json_schema.py +++ b/tests/test_json_schema.py @@ -33,10 +33,11 @@ import pytest from dirty_equals import HasRepr from pydantic_core import CoreSchema, SchemaValidator, core_schema, to_json -from typing_extensions import Annotated, L...
["tests/test_json_schema.py::test_repeated_custom_type"]
["tests/test_json_schema.py::test_ipv6network_type", "tests/test_json_schema.py::test_schema_attributes", "tests/test_json_schema.py::test_secrets_schema[min-max-constraints-SecretStr]", "tests/test_json_schema.py::test_dataclass_with_extra_ignore", "tests/test_json_schema.py::test_constraints_schema_serialization[kwar...
null
true
2023-11-09T08:40:23Z
1
9
1
2,321
0
0.85
1
1
1
0.416833
95.4005
35
swe_bench_verified::test::494
swe_bench_verified
test
494
sympy__sympy-24066
sympy/sympy
sympy/sympy
python
514579c655bf22e2af14f0743376ae1d7befe345
SI._collect_factor_and_dimension() cannot properly detect that exponent is dimensionless How to reproduce: ```python from sympy import exp from sympy.physics import units from sympy.physics.units.systems.si import SI expr = units.second / (units.ohm * units.farad) dim = SI._collect_factor_and_dimension(expr)[1] asse...
diff --git a/sympy/physics/units/unitsystem.py b/sympy/physics/units/unitsystem.py --- a/sympy/physics/units/unitsystem.py +++ b/sympy/physics/units/unitsystem.py @@ -190,10 +190,9 @@ def _collect_factor_and_dimension(self, expr): dim /= idim**count return factor, dim elif isinsta...
diff --git a/sympy/physics/units/tests/test_quantities.py b/sympy/physics/units/tests/test_quantities.py --- a/sympy/physics/units/tests/test_quantities.py +++ b/sympy/physics/units/tests/test_quantities.py @@ -541,6 +541,27 @@ def test_issue_20288(): assert SI._collect_factor_and_dimension(expr) == (1 + E, Dimens...
["test_issue_24062"]
["test_str_repr", "test_eq", "test_convert_to", "test_Quantity_definition", "test_abbrev", "test_print", "test_Quantity_eq", "test_add_sub", "test_quantity_abs", "test_check_unit_consistency", "test_mul_div", "test_units", "test_issue_quart", "test_issue_5565", "test_find_unit", "test_Quantity_derivative", "test_quanti...
null
true
2022-09-16T22:58:15Z
1
7
1
588
0
1
1
1
1
0.121333
95.364
36
swe_gym::train::499
swe_gym
train
499
python__mypy-15976
python/mypy
python/mypy
python
d7b24514d7301f86031b7d1e2215cf8c2476bec0
attrs & dataclasses false positive error with slots=True when subclassing from non-slots base class **Bug Report** With `attrs.define(slots=True)` and `dataclass(slots=True)`, if the base class doesn't use `__slots__` then mypy shouldn't error when assigning new attributes to the instance. **To Reproduce** ```pyth...
Looks like the logic is to ignore `__slots__` if anyone in the MRO doesn't have it: https://github.com/python/mypy/blob/6f650cff9ab21f81069e0ae30c92eae94219ea63/mypy/semanal.py#L4645-L4648
diff --git a/mypy/plugins/attrs.py b/mypy/plugins/attrs.py --- a/mypy/plugins/attrs.py +++ b/mypy/plugins/attrs.py @@ -893,6 +893,11 @@ def _add_attrs_magic_attribute( def _add_slots(ctx: mypy.plugin.ClassDefContext, attributes: list[Attribute]) -> None: + if any(p.slots is None for p in ctx.cls.info.mro[1:-1])...
diff --git a/test-data/unit/check-dataclasses.test b/test-data/unit/check-dataclasses.test --- a/test-data/unit/check-dataclasses.test +++ b/test-data/unit/check-dataclasses.test @@ -1519,6 +1519,22 @@ class Some: self.y = 1 # E: Trying to assign name "y" that is not in "__slots__" of type "__main__.Some" [b...
["mypy/test/testcheck.py::TypeCheckSuite::check-dataclasses.test::testDataclassWithSlotsDerivedFromNonSlot", "mypy/test/testcheck.py::TypeCheckSuite::check-plugin-attrs.test::testAttrsClassWithSlotsDerivedFromNonSlots"]
["mypy/test/testcheck.py::TypeCheckSuite::check-plugin-attrs.test::testRuntimeSlotsAttr", "mypy/test/testcheck.py::TypeCheckSuite::check-dataclasses.test::testDataclassWithSlotsConflict"]
null
true
2023-08-28T04:20:29Z
2
11
2
1,954
0
0.85
1
1
1
0.362333
95.237
37
swe_gym::train::322
swe_gym
train
322
getmoto__moto-5620
getmoto/moto
getmoto/moto
python
80db33cb44c77331b3b53bc7cba2caf56e61c5fb
Dynamodb update_item does not raise ValidationException when changing the partition key Hi, The `update_item` method on the `resource("dynamodb").Table("table_name")` object should raise ValidationException if the user tries to change the partition key. Specifically it should raise: `botocore.exceptions.ClientError:...
Thanks for raising this and adding a repro case @LiamCato!
diff --git a/moto/dynamodb/parsing/validators.py b/moto/dynamodb/parsing/validators.py --- a/moto/dynamodb/parsing/validators.py +++ b/moto/dynamodb/parsing/validators.py @@ -341,8 +341,9 @@ def check_for_empty_string_key_value(self, node): class UpdateHashRangeKeyValidator(DepthFirstTraverser): - def __init__(...
diff --git a/tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py b/tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py --- a/tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py +++ b/tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py @@ -798,3 +798,75 @@ def test_transact_write_items_multip...
["tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py::test_update_primary_key", "tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py::test_update_primary_key_with_sortkey"]
["tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py::test_query_gsi_with_wrong_key_attribute_names_throws_exception", "tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py::test_update_expression_with_trailing_comma", "tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py::test_hash_key_can_only_use...
null
true
2022-10-30 12:50:09
1
10
2
1,797
0
0.85
1
1
1
0.332833
95.1485
38
swe_gym::train::2384
swe_gym
train
2,384
modin-project__modin-6798
modin-project/modin
modin-project/modin
python
b8202f127d79b20076126edce85dd63a59e4a677
BUG: Columns insertion doesn't work with `.loc` accessor ### Modin version checks - [X] I have checked that this issue has not already been reported. - [X] I have confirmed this bug exists on the latest released version of Modin. - [X] I have confirmed this bug exists on the main branch of Modin. (In order to do thi...
a workaround would be: ```python # df.loc[:, "col_name"] = [1, 2, 3] df["col_name"] = [1, 2, 3] ```
diff --git a/modin/pandas/indexing.py b/modin/pandas/indexing.py --- a/modin/pandas/indexing.py +++ b/modin/pandas/indexing.py @@ -813,7 +813,7 @@ def _setitem_with_new_columns(self, row_loc, col_loc, item): ---------- row_loc : scalar, slice, list, array or tuple Row locator. - co...
diff --git a/modin/pandas/test/dataframe/test_indexing.py b/modin/pandas/test/dataframe/test_indexing.py --- a/modin/pandas/test/dataframe/test_indexing.py +++ b/modin/pandas/test/dataframe/test_indexing.py @@ -515,6 +515,31 @@ def test_loc_4456( eval_loc(modin_df, pandas_df, (mdf_value, pdf_value), key) +def ...
["modin/pandas/test/dataframe/test_indexing.py::test_loc_6774"]
["modin/pandas/test/dataframe/test_indexing.py::test_reset_index_with_multi_index_no_drop[True-1-False-0-no_col_level-0-False-3-float_nan_data-True]", "modin/pandas/test/dataframe/test_indexing.py::test_reset_index_with_multi_index_no_drop[mixed_1st_None-0-False-None-2-no_level-False-3-float_nan_data-True]", "modin/pan...
null
true
2023-12-04T05:14:59Z
1
6
1
1,713
0
0.85
1
1
1
0.3055
95.0665
39
swe_gym::train::186
swe_gym
train
186
getmoto__moto-5835
getmoto/moto
getmoto/moto
python
6da12892a3c18248a2cfe55bc7d2cb3039817684
Type not validated with SSM put_parameter # Steps to reproduce ``` import boto3 from moto import mock_ssm with mock_ssm(): client=boto3.client('ssm') param_name = 'test_param' client.put_parameter( Name=param_name, Value="Contents of param", Type='str' # this is a bug in my code I ...
I've tried to spot where validation is supposed to be done. We could add a check here somewhere: https://github.com/spulec/moto/blob/8f074b0799e4e5303f219549e177d52b016c2dfb/moto/ssm/models.py#L188 But isn't moto supposed to do this with some programmatic magic, prior to getting to the hand-crafted code? All of ...
diff --git a/moto/ssm/models.py b/moto/ssm/models.py --- a/moto/ssm/models.py +++ b/moto/ssm/models.py @@ -851,6 +851,14 @@ def _document_filter_match(account_id, filters, ssm_doc): return True +def _valid_parameter_type(type_): + """ + Parameter Type field only allows `SecureString`, `StringList` and `S...
diff --git a/tests/test_ssm/test_ssm_boto3.py b/tests/test_ssm/test_ssm_boto3.py --- a/tests/test_ssm/test_ssm_boto3.py +++ b/tests/test_ssm/test_ssm_boto3.py @@ -414,6 +414,23 @@ def test_put_parameter_invalid_data_type(bad_data_type): ) +@mock_ssm +def test_put_parameter_invalid_type(): + client = boto3.c...
["tests/test_ssm/test_ssm_boto3.py::test_put_parameter_invalid_type"]
["tests/test_ssm/test_ssm_boto3.py::test_get_parameters_should_only_return_unique_requests", "tests/test_ssm/test_ssm_boto3.py::test_describe_parameters_attributes", "tests/test_ssm/test_ssm_boto3.py::test_describe_parameters_invalid_parameter_filters[filters6-The", "tests/test_ssm/test_ssm_boto3.py::test_describe_para...
null
true
2023-01-12 06:54:57
1
13
1
1,515
0
0.85
1
1
1
0.295833
95.0375
40
swe_gym::train::1500
swe_gym
train
1,500
pandas-dev__pandas-56055
pandas-dev/pandas
pandas-dev/pandas
python
d22adf6a4bed08050b161207d86e02c1bec6d5c4
BUG: inconsistency in Index.__getitem__ for Numpy and non-numpy dtypes ### Pandas version checks - [X] I have checked that this issue has not already been reported. - [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas. - [X] I have confirmed thi...
requiring matching length for a mask seems right to me, so the numpy version looks wrong I suppose the underlying reason that this works for the numpy version, is because numpy arrays seem to allow this: ``` >>> arr = np.array([1, 2], dtype="int64") >>> arr[np.array([], dtype=np.bool_)] array([], dtype=int64) ``...
diff --git a/doc/source/whatsnew/v2.2.0.rst b/doc/source/whatsnew/v2.2.0.rst index b0f51751b027c..6c45e247f949e 100644 --- a/doc/source/whatsnew/v2.2.0.rst +++ b/doc/source/whatsnew/v2.2.0.rst @@ -289,6 +289,7 @@ Other Deprecations - Deprecated automatic downcasting of object-dtype results in :meth:`Series.replace` an...
diff --git a/pandas/tests/indexes/test_base.py b/pandas/tests/indexes/test_base.py index 7620bf272db11..dc624f0271a73 100644 --- a/pandas/tests/indexes/test_base.py +++ b/pandas/tests/indexes/test_base.py @@ -462,7 +462,11 @@ def test_empty_fancy(self, index, dtype): empty_index = type(index)([], dtype=index.d...
["pandas/tests/indexes/test_base.py::TestIndex::test_empty_fancy[bool_-int64]", "pandas/tests/indexes/test_base.py::TestIndex::test_empty_fancy[bool_-int32]", "pandas/tests/indexes/test_base.py::TestIndex::test_empty_fancy[bool_-string]", "pandas/tests/indexes/test_base.py::TestIndex::test_empty_fancy[bool_-uint32]", "...
["pandas/tests/internals/test_internals.py::TestShouldStore::test_should_store_categorical", "pandas/tests/indexes/test_base.py::test_generated_op_names[complex64-lt]", "pandas/tests/indexes/test_base.py::TestIndex::test_constructor_regular[bool-dtype]", "pandas/tests/indexes/test_base.py::test_generated_op_names[multi...
null
true
2023-11-19T00:12:19Z
2
11
7
1,555
0
0.85
1
1
1
0.295833
95.0375
41
swe_bench_verified::test::52
swe_bench_verified
test
52
django__django-11532
django/django
django/django
python
a5308514fb4bc5086c9a16a8a24a945eeebb073c
Email messages crash on non-ASCII domain when email encoding is non-unicode. Description When the computer hostname is set in unicode (in my case "正宗"), the following test fails: ​https://github.com/django/django/blob/master/tests/mail/tests.py#L368 Specifically, since the encoding is set to iso-8859-1, Python attempt...
Thanks for the report. Simple encoding should fix this issue, e.g. diff --git a/django/core/mail/utils.py b/django/core/mail/utils.py index d18dfe4667..68f9e464d6 100644 --- a/django/core/mail/utils.py +++ b/django/core/mail/utils.py @@ -14,6 +14,10 @@ class CachedDnsName: def get_fqdn(self): if not hasattr(self, '_fqd...
diff --git a/django/core/mail/message.py b/django/core/mail/message.py --- a/django/core/mail/message.py +++ b/django/core/mail/message.py @@ -16,7 +16,7 @@ from django.conf import settings from django.core.mail.utils import DNS_NAME -from django.utils.encoding import force_str +from django.utils.encoding import fo...
diff --git a/tests/mail/tests.py b/tests/mail/tests.py --- a/tests/mail/tests.py +++ b/tests/mail/tests.py @@ -14,10 +14,11 @@ from io import StringIO from smtplib import SMTP, SMTPAuthenticationError, SMTPException from ssl import SSLError +from unittest import mock from django.core import mail from django.core...
["test_non_ascii_dns_non_unicode_email (mail.tests.MailTests)"]
["test_7bit (mail.tests.PythonGlobalState)", "test_8bit_latin (mail.tests.PythonGlobalState)", "test_8bit_non_latin (mail.tests.PythonGlobalState)", "test_utf8 (mail.tests.PythonGlobalState)", "test_date_header_localtime (mail.tests.MailTimeZoneTests)", "test_date_header_utc (mail.tests.MailTimeZoneTests)", "test_close...
null
true
2019-07-02T10:29:28Z
5
26
1
2,664
0
1
1
1
0.85
0.530667
95.0295
42
swe_gym::train::583
swe_gym
train
583
python__mypy-16905
python/mypy
python/mypy
python
837f7e0ed4f87869f314ec102c0d6e47ec3272ec
`mypy` unable to narrow type of tuple elements in `case` clause in pattern matching **Bug Report** When using `match` on a tuple, `mypy` is unable to apply type narrowing when a `case` clause specifies the type of the elements of the tuple. **To Reproduce** Run this code through `mypy`: ```python class MyClass: ...
Yeah, mypy doesn't narrow on tuples. I commented on it here: https://github.com/python/mypy/pull/12267#issuecomment-1058132318 But apparently the worry is that it is too computationally expensive. EDIT: hmm, maybe it's not the same problem actually I just ran into this exact problem in a codebase I'm converting to my...
diff --git a/mypy/checker.py b/mypy/checker.py --- a/mypy/checker.py +++ b/mypy/checker.py @@ -5086,6 +5086,9 @@ def visit_match_stmt(self, s: MatchStmt) -> None: ) self.remove_capture_conflicts(pattern_type.captures, inferred_types) self.push_t...
diff --git a/test-data/unit/check-python310.test b/test-data/unit/check-python310.test --- a/test-data/unit/check-python310.test +++ b/test-data/unit/check-python310.test @@ -341,6 +341,72 @@ match m: reveal_type(m) # N: Revealed type is "builtins.list[builtins.list[builtins.str]]" [builtins fixtures/list.py...
["mypy/test/testcheck.py::TypeCheckSuite::check-python310.test::testMatchSequencePatternNarrowSubjectItemsRecursive", "mypy/test/testcheck.py::TypeCheckSuite::check-python310.test::testMatchSequencePatternNarrowSubjectItems"]
["mypy/test/testcheck.py::TypeCheckSuite::check-python310.test::testMatchMappingPatternCapturesTypedDictWithLiteral", "mypy/test/testcheck.py::TypeCheckSuite::check-python310.test::testMatchMappingPatternCapturesTypedDictUnreachable", "mypy/test/testcheck.py::TypeCheckSuite::check-python310.test::testMatchMappingPatter...
null
true
2024-02-11T14:51:16Z
1
17
2
1,391
0
0.85
1
1
1
0.2885
95.0155
43
swe_bench_pro::test::38
swe_bench_pro
test
38
instance_ansible__ansible-0ea40e09d1b35bcb69ff4d9cecf3d0defa4b36e8-v30a923fb5c164d6cd18280c02422f75e611e8fb2
ansible/ansible
ansible/ansible
python
f7234968d241d7171aadb1e873a67510753f3163
## Title TypeError combining `VarsWithSources` and `dict` in `combine_vars` ## Description When executing logic that calls `ansible.utils.vars.combine_vars(a, b)` with `a` of type `dict` and `b` of type `VarsWithSources`, with `DEFAULT_HASH_BEHAVIOUR='replace'`, a `TypeError` occurs when attempting to apply the join...
## Requirements - `ansible.vars.manager.VarsWithSources` must interoperate with a standard mapping on the left-hand side of the union operator (`|`). When a standard mapping is the left operand and a `VarsWithSources` instance is the right operand (`mapping | VarsWithSources`), the operation must succeed and produce a ...
diff --git a/changelogs/fragments/81659_varswithsources.yml b/changelogs/fragments/81659_varswithsources.yml new file mode 100644 index 00000000000000..32133e1c4e3ad8 --- /dev/null +++ b/changelogs/fragments/81659_varswithsources.yml @@ -0,0 +1,3 @@ +--- +bugfixes: +- vars - handle exception while combining VarsWithSou...
diff --git a/test/units/utils/test_vars.py b/test/units/utils/test_vars.py index 9be33de429a9ae..727e04c86f1d0a 100644 --- a/test/units/utils/test_vars.py +++ b/test/units/utils/test_vars.py @@ -27,6 +27,7 @@ from units.compat import unittest from ansible.errors import AnsibleError from ansible.utils.vars import com...
["test/units/utils/test_vars.py::TestVariableUtils::test_combine_vars_replace"]
["test/units/utils/test_vars.py::TestVariableUtils::test_merge_hash_non_recursive_and_list_append_rp", "test/units/utils/test_vars.py::TestVariableUtils::test_merge_hash_non_recursive_and_list_keep", "test/units/utils/test_vars.py::TestVariableUtils::test_merge_hash_non_recursive_and_list_replace", "test/units/utils/te...
ghcr.io/scaleapi/swe-bench_pro-v2:instance_ansible__ansible-0ea40e09d1b35bcb69ff4d9cecf3d0defa4b36e8-v30a923fb5c164d6cd18280c02422f75e611e8fb2
true
null
3
32
1
1,248
0
0.95
1
1
1
0.314667
94.994
44
swe_gym::train::2299
swe_gym
train
2,299
Project-MONAI__MONAI-5924
Project-MONAI/MONAI
project-monai/monai
python
b59216458751db89598219f318f3ead2643fdf11
Metrics fails or wrong output device with CUDA **Describe the bug** Hello, some metrics have bugs when used with CUDA tensors. In particular, Generalized Dice Score fails with the following error when both `y_pred` and `y` are on the same CUDA device. `RuntimeError: Expected all tensors to be on the same device, but ...
Hi @yiheng-wang-nv , Seems there is some issue here? Could you please help take a look and may submit a PR to fix it? Thanks in advance. Hi @matteo-bastico , for `Generalized Dice Score`, I did not meet same issue. Could you please run the following code and post the exact monai version? ``` from monai.config...
diff --git a/monai/metrics/hausdorff_distance.py b/monai/metrics/hausdorff_distance.py --- a/monai/metrics/hausdorff_distance.py +++ b/monai/metrics/hausdorff_distance.py @@ -23,7 +23,7 @@ ignore_background, is_binary_tensor, ) -from monai.utils import MetricReduction +from monai.utils import MetricReduction...
diff --git a/tests/test_surface_dice.py b/tests/test_surface_dice.py --- a/tests/test_surface_dice.py +++ b/tests/test_surface_dice.py @@ -277,17 +277,17 @@ def test_not_predicted_not_present(self): # test aggregation res_bgr = sur_metric_bgr.aggregate(reduction="mean") - np.testing.assert_eq...
["tests/test_surface_dice.py::TestAllSurfaceDiceMetrics::test_not_predicted_not_present"]
["tests/test_surface_dice.py::TestAllSurfaceDiceMetrics::test_tolerance_all_distances", "tests/test_surface_dice.py::TestAllSurfaceDiceMetrics::test_tolerance_euclidean_distance", "tests/test_surface_dice.py::TestAllSurfaceDiceMetrics::test_asserts"]
null
true
2023-02-01T04:33:32Z
3
20
1
1,233
0
0.85
1
1
1
0.272167
94.9665
45
swe_gym::train::538
swe_gym
train
538
python__mypy-10458
python/mypy
python/mypy
python
551eea3697d0740838aa978b2a61e6f7e771c3e2
Awaiting on `Awaitable[Tuple[NoReturn, ...]]` **Bug Report** Mypy raises "Implicit return in function which does not return [misc]" when awaiting on `Awaitable[Tuple[NoReturn, ...]]` (and similar) inside `NoReturn` coroutine. **To Reproduce** 1) Run Mypy against following example: ``` from typing import TypeVar, ...
1) check out `reveal_type`! (re: "I don't know how to inspect inferred types") 2) `gather` should probably return `Tuple[T1, T2]`, not `Awaitable[Tuple[T1, T2]]`. 3) I think the problem is more generic than this, as this fails typechecking: ```py from typing import NoReturn async def no_return() -> NoRetur...
diff --git a/mypy/checkexpr.py b/mypy/checkexpr.py --- a/mypy/checkexpr.py +++ b/mypy/checkexpr.py @@ -4042,7 +4042,11 @@ def check_awaitable_expr(self, t: Type, ctx: Context, msg: str) -> Type: return AnyType(TypeOfAny.special_form) else: generator = self.check_method_call_by_name('_...
diff --git a/test-data/unit/check-flags.test b/test-data/unit/check-flags.test --- a/test-data/unit/check-flags.test +++ b/test-data/unit/check-flags.test @@ -334,6 +334,20 @@ from mypy_extensions import NoReturn x = 0 # type: NoReturn # E: Incompatible types in assignment (expression has type "int", variable has ty...
["mypy/test/testcheck.py::TypeCheckSuite::testNoReturnAsync"]
["mypy/test/testcheck.py::TypeCheckSuite::testNoReturnImportFromTyping"]
null
true
2021-05-11T03:19:41Z
1
6
1
1,416
0
0.85
1
1
1
0.256
94.918
46
swe_gym::train::582
swe_gym
train
582
python__mypy-17071
python/mypy
python/mypy
python
4310586460e0af07fa8994a0b4f03cb323e352f0
A callable typed function is not recognised as a TypeVar-ed argument **Bug Report** I give my function a typed Callable, I get an error: **To Reproduce** ``` def type_guard(x: Any, type_check_func: Callable[[Any], TypeGuard[T]]) -> T: if not type_check_func(x): raise TypeError("failed type asseti...
Still reproduces on 1.9.0: https://mypy-play.net/?mypy=latest&python=3.10&gist=bd80437034ccf2a3142a5dc74b1fb7b1 I imagine the code that produces that error doesn't know to look inside the TypeGuard. If so, this should be an easy fix. Still reproduces on 1.9.0: https://mypy-play.net/?mypy=latest&python=3.10&gist=bd80...
diff --git a/mypy/typetraverser.py b/mypy/typetraverser.py --- a/mypy/typetraverser.py +++ b/mypy/typetraverser.py @@ -86,6 +86,12 @@ def visit_callable_type(self, t: CallableType) -> None: t.ret_type.accept(self) t.fallback.accept(self) + if t.type_guard is not None: + t.type_guar...
diff --git a/test-data/unit/check-typeguard.test b/test-data/unit/check-typeguard.test --- a/test-data/unit/check-typeguard.test +++ b/test-data/unit/check-typeguard.test @@ -54,6 +54,18 @@ def main(a: object, b: object) -> None: reveal_type(b) # N: Revealed type is "builtins.object" [builtins fixtures/tuple...
["mypy/test/testcheck.py::TypeCheckSuite::check-typeguard.test::testTypeGuardTypeVarReturn", "mypy/test/testcheck.py::TypeCheckSuite::check-typeis.test::testTypeIsTypeVarReturn"]
["mypy/test/testcheck.py::TypeCheckSuite::check-typeis.test::testTypeIsUnionIn", "mypy/test/testcheck.py::TypeCheckSuite::check-typeguard.test::testTypeGuardIsBool"]
null
true
2024-03-28T17:38:00Z
1
6
2
1,386
0
0.85
1
1
1
0.251
94.903
47
swe_gym::train::1199
swe_gym
train
1,199
pandas-dev__pandas-56334
pandas-dev/pandas
pandas-dev/pandas
python
0b9e784fe5606d8383a8e825e5475d35e9552a2a
BUG: `str.extract` Method Not Implemented for `pd.ArrowDtype(pa.string())` ### Pandas version checks - [X] I have checked that this issue has not already been reported. - [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas. - [ ] I have confirmed...
cc @mroeschke what's the status quo here? Yeah at the time never got around to implementing this one (this one was tricky since it can return a Series or DataFrame), but should be available from the pyarrow side with `extract_regex` https://arrow.apache.org/docs/python/generated/pyarrow.compute.extract_regex.html#pyarr...
diff --git a/doc/source/whatsnew/v2.2.0.rst b/doc/source/whatsnew/v2.2.0.rst index 318f746917fcd..7192cb9aef195 100644 --- a/doc/source/whatsnew/v2.2.0.rst +++ b/doc/source/whatsnew/v2.2.0.rst @@ -226,6 +226,7 @@ Other enhancements - Allow passing ``read_only``, ``data_only`` and ``keep_links`` arguments to openpyxl u...
diff --git a/pandas/tests/extension/test_arrow.py b/pandas/tests/extension/test_arrow.py index 7131a50956a7d..8e555cfe64629 100644 --- a/pandas/tests/extension/test_arrow.py +++ b/pandas/tests/extension/test_arrow.py @@ -2150,14 +2150,40 @@ def test_str_rsplit(): tm.assert_frame_equal(result, expected) -def te...
["pandas/tests/extension/test_arrow.py::test_str_extract[False]", "pandas/tests/extension/test_arrow.py::test_str_extract[True]", "pandas/tests/extension/test_arrow.py::test_str_extract_expand", "pandas/tests/extension/test_arrow.py::test_str_extract_non_symbolic"]
["pandas/tests/extension/test_arrow.py::TestArrowArray::test_setitem_mask[False-int32-numpy-array]", "pandas/tests/extension/test_arrow.py::TestArrowArray::test_value_counts_returns_pyarrow_int64[timestamp[ms,", "pandas/tests/extension/test_arrow.py::TestArrowArray::test_argmin_argmax[uint32]", "pandas/tests/extension/...
null
true
2023-12-05T00:19:39Z
2
17
4
1,119
0
0.85
1
1
1
0.243167
94.8795
48
swe_gym::train::1581
swe_gym
train
1,581
pandas-dev__pandas-52952
pandas-dev/pandas
pandas-dev/pandas
python
f990ab01ed1991a5ed8be9bc08135fdf78794050
BUG: to_pydatetime() -> 'pyarrow.lib.DataType' object has no attribute 'unit' ### Pandas version checks - [X] I have checked that this issue has not already been reported. - [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas. - [ ] I have confir...
Can you post the pull traceback? ```python ~/.local/lib/python3.9/site-packages/pandas/core/indexes/accessors.py in to_pydatetime(self) 211 212 def to_pydatetime(self): --> 213 return cast(ArrowExtensionArray, self._parent.array)._dt_to_pydatetime() 214 215 def isocalendar(self):...
diff --git a/doc/source/whatsnew/v2.0.2.rst b/doc/source/whatsnew/v2.0.2.rst index adfebd857b390..3ee7031795d16 100644 --- a/doc/source/whatsnew/v2.0.2.rst +++ b/doc/source/whatsnew/v2.0.2.rst @@ -31,7 +31,7 @@ Bug fixes Other ~~~~~ -- +- Raised a better error message when calling :func:`Series.dt.to_pydatetime` wi...
diff --git a/pandas/tests/extension/test_arrow.py b/pandas/tests/extension/test_arrow.py index 4caa982fa7b64..e4115e235cd6b 100644 --- a/pandas/tests/extension/test_arrow.py +++ b/pandas/tests/extension/test_arrow.py @@ -2615,6 +2615,19 @@ def test_dt_to_pydatetime(): tm.assert_numpy_array_equal(result, expected) ...
["pandas/tests/extension/test_arrow.py::test_dt_to_pydatetime_date_error[32]", "pandas/tests/extension/test_arrow.py::test_dt_to_pydatetime_date_error[64]"]
["pandas/tests/extension/test_arrow.py::TestBaseSetitem::test_setitem_scalar[timestamp[s,", "pandas/tests/extension/test_arrow.py::TestConstructors::test_from_dtype[timestamp[us,", "pandas/tests/extension/test_arrow.py::TestBaseMethods::test_shift_0_periods[binary]", "pandas/tests/extension/test_arrow.py::TestBaseInter...
null
true
2023-04-27T00:34:04Z
2
7
2
1,136
0
0.85
1
1
1
0.212667
94.788
49
swe_gym::train::1712
swe_gym
train
1,712
pandas-dev__pandas-56650
pandas-dev/pandas
pandas-dev/pandas
python
62dbbe6713b6467ff10673eb10adaf4342e67780
BUG: Cannot access Timedelta properties with Arrow Backend ### Pandas version checks - [X] I have checked that this issue has not already been reported. - [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas. - [ ] I have confirmed this bug exists...
Thanks for the report. We are hoping pyarrow will include compute functions for timedeltas soon enough https://github.com/apache/arrow/issues/33962 Closing as awaiting an implementation in https://github.com/apache/arrow/issues/33962 Just going back through my bug list. Is it valid to close this as `.dt` is still missi...
diff --git a/doc/source/whatsnew/v2.2.0.rst b/doc/source/whatsnew/v2.2.0.rst index 5b955aa45219a..f7e1cc9cbe36d 100644 --- a/doc/source/whatsnew/v2.2.0.rst +++ b/doc/source/whatsnew/v2.2.0.rst @@ -316,6 +316,7 @@ Other enhancements - :meth:`Series.ffill`, :meth:`Series.bfill`, :meth:`DataFrame.ffill`, and :meth:`DataF...
diff --git a/pandas/tests/extension/test_arrow.py b/pandas/tests/extension/test_arrow.py index 3b03272f18203..dad2c0ce5995a 100644 --- a/pandas/tests/extension/test_arrow.py +++ b/pandas/tests/extension/test_arrow.py @@ -2723,6 +2723,111 @@ def test_dt_tz_convert(unit): tm.assert_series_equal(result, expected) ...
["pandas/tests/extension/test_arrow.py::test_dt_timedelta_properties[nanoseconds-4]", "pandas/tests/extension/test_arrow.py::test_dt_timedelta_properties[microseconds-3]", "pandas/tests/extension/test_arrow.py::test_dt_timedelta_total_seconds", "pandas/tests/extension/test_arrow.py::test_dt_timedelta_properties[seconds...
["pandas/tests/extension/test_arrow.py::TestArrowArray::test_setitem_mask[False-int32-numpy-array]", "pandas/tests/extension/test_arrow.py::TestArrowArray::test_value_counts_returns_pyarrow_int64[timestamp[ms,", "pandas/tests/extension/test_arrow.py::TestArrowArray::test_argmin_argmax[uint32]", "pandas/tests/extension/...
null
true
2023-12-28T01:23:14Z
3
127
9
3,157
0
0.85
1
0.92
1
0.923333
94.64
50
swe_bench_verified::test::11
swe_bench_verified
test
11
astropy__astropy-14369
astropy/astropy
astropy/astropy
python
fa4e8d1cd279acf9b24560813c8652494ccd5922
Incorrect units read from MRT (CDS format) files with astropy.table ### Description When reading MRT files (formatted according to the CDS standard which is also the format recommended by AAS/ApJ) with `format='ascii.cds'`, astropy.table incorrectly parses composite units. According to CDS standard the units should be...
Welcome to Astropy 👋 and thank you for your first issue! A project member will respond to you as soon as possible; in the meantime, please double-check the [guidelines for submitting issues](https://github.com/astropy/astropy/blob/main/CONTRIBUTING.md#reporting-issues) and make sure you've provided the requested deta...
diff --git a/astropy/units/format/cds.py b/astropy/units/format/cds.py --- a/astropy/units/format/cds.py +++ b/astropy/units/format/cds.py @@ -138,8 +138,7 @@ def _make_parser(cls): for Astronomical Catalogues 2.0 <http://vizier.u-strasbg.fr/vizier/doc/catstd-3.2.htx>`_, which is not terribly...
diff --git a/astropy/units/tests/test_format.py b/astropy/units/tests/test_format.py --- a/astropy/units/tests/test_format.py +++ b/astropy/units/tests/test_format.py @@ -60,9 +60,13 @@ def test_unit_grammar_fail(string): (["mW/m2"], u.Unit(u.erg / u.cm**2 / u.s)), (["mW/(m2)"], u.Unit(u.erg / u.cm**2...
["astropy/units/tests/test_format.py::test_cds_grammar[strings4-unit4]", "astropy/units/tests/test_format.py::test_cds_grammar[strings6-unit6]", "astropy/units/tests/test_format.py::test_cds_grammar_fail[km/s.Mpc-1]"]
["astropy/units/tests/test_format.py::test_unit_grammar[strings0-unit0]", "astropy/units/tests/test_format.py::test_unit_grammar[strings1-unit1]", "astropy/units/tests/test_format.py::test_unit_grammar[strings2-unit2]", "astropy/units/tests/test_format.py::test_unit_grammar[strings3-unit3]", "astropy/units/tests/test_f...
null
true
2023-02-06T21:56:51Z
2
65
3
2,501
0
1
1
0.85
1
0.6335
94.6255
51
swe_gym::train::2362
swe_gym
train
2,362
modin-project__modin-6905
modin-project/modin
modin-project/modin
python
abbbd03023f55d4ee9592c4c695308e10a97cb4c
BUG: Partial dtypes doesn't work when mixing MultiIndex and non-MultiIndex columns ### Modin version checks - [X] I have checked that this issue has not already been reported. - [X] I have confirmed this bug exists on the latest released version of Modin. - [X] I have confirmed this bug exists on the main branch of ...
diff --git a/modin/core/dataframe/pandas/metadata/dtypes.py b/modin/core/dataframe/pandas/metadata/dtypes.py --- a/modin/core/dataframe/pandas/metadata/dtypes.py +++ b/modin/core/dataframe/pandas/metadata/dtypes.py @@ -159,7 +159,10 @@ def columns_order(self) -> Optional[dict[int, IndexLabel]]: if self._parent...
diff --git a/modin/test/storage_formats/pandas/test_internals.py b/modin/test/storage_formats/pandas/test_internals.py --- a/modin/test/storage_formats/pandas/test_internals.py +++ b/modin/test/storage_formats/pandas/test_internals.py @@ -30,7 +30,12 @@ ) from modin.core.storage_formats.pandas.utils import split_resu...
["modin/test/storage_formats/pandas/test_internals.py::TestModinDtypes::test_reset_index_mi_columns"]
["modin/test/storage_formats/pandas/test_internals.py::test_reorder_labels_cache[unbalanced_partitioning-no_reordering-projection_only]", "modin/test/storage_formats/pandas/test_internals.py::TestZeroComputationDtypes::test_preserve_dtypes_setitem[3.5-value_dtype0-unknown]", "modin/test/storage_formats/pandas/test_inte...
null
true
2024-02-02T17:11:22Z
1
106
1
2,614
0
0.85
1
1
1
0.789
94.517
52
swe_gym::train::1620
swe_gym
train
1,620
pandas-dev__pandas-56245
pandas-dev/pandas
pandas-dev/pandas
python
a3af1523938765527188fa779277d1cccb3e9900
BUG: __eq__ raises NotImplementedError for new arrow string dtype ### Reproducible Example ```python ser = pd.Series([False, True]) ser2 = pd.Series(["a", "b"], dtype="string[pyarrow_numpy]") ser == ser2 ``` ### Issue Description This shouldn't raise if we want to emulate object dtype behavior ### Expected Behavior...
Regardless of exactly emulating object dtype, we should maybe ask ourselves the more general question: how does pandas handle equality comparisons of incompatible dtypes in general? (or at least with the non-arrow dtypes) At the moment, it seems we just never raise an error, with one exception for comparing two cate...
diff --git a/doc/source/whatsnew/v2.2.0.rst b/doc/source/whatsnew/v2.2.0.rst index 70039cc697b8a..cda4da9d76c42 100644 --- a/doc/source/whatsnew/v2.2.0.rst +++ b/doc/source/whatsnew/v2.2.0.rst @@ -604,6 +604,7 @@ Strings - Bug in :meth:`Series.str.find` when ``start < 0`` for :class:`ArrowDtype` with ``pyarrow.string`...
diff --git a/pandas/tests/series/test_logical_ops.py b/pandas/tests/series/test_logical_ops.py index 153b4bfaaf444..d9c94e871bd4b 100644 --- a/pandas/tests/series/test_logical_ops.py +++ b/pandas/tests/series/test_logical_ops.py @@ -530,3 +530,19 @@ def test_int_dtype_different_index_not_bool(self): result =...
["pandas/tests/series/test_logical_ops.py::TestSeriesLogicalOps::test_pyarrow_numpy_string_invalid"]
["pandas/tests/series/test_logical_ops.py::TestSeriesLogicalOps::test_bool_operators_with_nas[xor]", "pandas/tests/series/test_logical_ops.py::TestSeriesLogicalOps::test_reversed_logical_op_with_index_returns_series[ror_]", "pandas/tests/series/test_logical_ops.py::TestSeriesLogicalOps::test_reversed_logical_op_with_in...
null
true
2023-11-29T23:22:39Z
2
7
1
481
0
0.85
1
1
1
0.1035
94.4605
53
swe_bench_verified::test::317
swe_bench_verified
test
317
pydata__xarray-7229
pydata/xarray
pydata/xarray
python
3aa75c8d00a4a2d4acf10d80f76b937cadb666b7
`xr.where(..., keep_attrs=True)` overwrites coordinate attributes ### What happened? #6461 had some unintended consequences for `xr.where(..., keep_attrs=True)`, where coordinate attributes are getting overwritten by variable attributes. I guess this has been broken since `2022.06.0`. ### What did you expect to happe...
Original looks like this: ```python # keep the attributes of x, the second parameter, by default to # be consistent with the `where` method of `DataArray` and `Dataset` keep_attrs = lambda attrs, context: attrs[1] ``` New one looks like this: ```python # keep the attributes of x, the second parameter, by defa...
diff --git a/xarray/core/computation.py b/xarray/core/computation.py --- a/xarray/core/computation.py +++ b/xarray/core/computation.py @@ -1855,15 +1855,13 @@ def where(cond, x, y, keep_attrs=None): Dataset.where, DataArray.where : equivalent methods """ + from .dataset import Dataset + if ke...
diff --git a/xarray/tests/test_computation.py b/xarray/tests/test_computation.py --- a/xarray/tests/test_computation.py +++ b/xarray/tests/test_computation.py @@ -1925,16 +1925,63 @@ def test_where() -> None: def test_where_attrs() -> None: - cond = xr.DataArray([True, False], dims="x", attrs={"attr": "cond"}) ...
["xarray/tests/test_computation.py::test_where_attrs"]
["xarray/tests/test_computation.py::test_signature_properties", "xarray/tests/test_computation.py::test_result_name", "xarray/tests/test_computation.py::test_ordered_set_union", "xarray/tests/test_computation.py::test_ordered_set_intersection", "xarray/tests/test_computation.py::test_join_dict_keys", "xarray/tests/test...
null
true
2022-10-26T21:45:01Z
1
29
1
2,744
0
1
1
0.85
1
0.554
94.387
54
swe_bench_verified::test::376
swe_bench_verified
test
376
scikit-learn__scikit-learn-25931
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
e3d1f9ac39e4bf0f31430e779acc50fb05fe1b64
X does not have valid feature names, but IsolationForest was fitted with feature names ### Describe the bug If you fit an `IsolationForest` using a `pd.DataFrame` it generates a warning ``` python X does not have valid feature names, but IsolationForest was fitted with feature names ``` This only seems to occur if y...
I tried this in Jupyter on windows. It is working fine. Also, I tried one more thing. The IsolationForest algorithm expects the input data to have column names (i.e., feature names) when it is fitted. If you create a DataFrame without column names, the algorithm may not work as expected. In your case, the X DataFrame...
diff --git a/sklearn/ensemble/_iforest.py b/sklearn/ensemble/_iforest.py --- a/sklearn/ensemble/_iforest.py +++ b/sklearn/ensemble/_iforest.py @@ -344,8 +344,10 @@ def fit(self, X, y=None, sample_weight=None): self.offset_ = -0.5 return self - # else, define offset_ wrt contamination ...
diff --git a/sklearn/ensemble/tests/test_iforest.py b/sklearn/ensemble/tests/test_iforest.py --- a/sklearn/ensemble/tests/test_iforest.py +++ b/sklearn/ensemble/tests/test_iforest.py @@ -339,3 +339,21 @@ def test_base_estimator_property_deprecated(): ) with pytest.warns(FutureWarning, match=warn_msg): ...
["sklearn/ensemble/tests/test_iforest.py::test_iforest_preserve_feature_names"]
["sklearn/ensemble/tests/test_iforest.py::test_iforest[42]", "sklearn/ensemble/tests/test_iforest.py::test_iforest_sparse[42]", "sklearn/ensemble/tests/test_iforest.py::test_iforest_error", "sklearn/ensemble/tests/test_iforest.py::test_recalculate_max_depth", "sklearn/ensemble/tests/test_iforest.py::test_max_samples_at...
null
true
2023-03-22T00:34:47Z
1
24
1
2,778
0
1
1
0.85
1
0.543
94.354
55
swe_bench_verified::test::418
swe_bench_verified
test
418
sphinx-doc__sphinx-9461
sphinx-doc/sphinx
sphinx-doc/sphinx
python
939c7bb7ff7c53a4d27df067cea637540f0e1dad
Methods decorated with @classmethod and @property do not get documented. **EDIT:** The problem seems to be that `type(BaseClass.baseclass_property)` returns `property`, thus sphinx can just lookup `BaseClass.baseclass_property.__doc__`. However, `type(BaseClass.baseclass_class_property)` returns the type of the returne...
Wow! I did not notice the improvement. I'll take a look. https://docs.python.org/3.9/library/functions.html#classmethod For anyone wondering, a way to work around this issue currently, that allows usage of attribute docstrings is to refactor ```python class A: @classmethod @property def fun(cls) ...
diff --git a/sphinx/domains/python.py b/sphinx/domains/python.py --- a/sphinx/domains/python.py +++ b/sphinx/domains/python.py @@ -852,6 +852,7 @@ class PyProperty(PyObject): option_spec = PyObject.option_spec.copy() option_spec.update({ 'abstractmethod': directives.flag, + 'classmethod': dire...
diff --git a/tests/roots/test-ext-autodoc/target/properties.py b/tests/roots/test-ext-autodoc/target/properties.py --- a/tests/roots/test-ext-autodoc/target/properties.py +++ b/tests/roots/test-ext-autodoc/target/properties.py @@ -2,5 +2,10 @@ class Foo: """docstring""" @property - def prop(self) -> int:...
["tests/test_domain_py.py::test_pyproperty", "tests/test_ext_autodoc_autoclass.py::test_properties", "tests/test_ext_autodoc_autoproperty.py::test_class_properties"]
["tests/test_domain_py.py::test_function_signatures", "tests/test_domain_py.py::test_domain_py_xrefs", "tests/test_domain_py.py::test_domain_py_xrefs_abbreviations", "tests/test_domain_py.py::test_domain_py_objects", "tests/test_domain_py.py::test_resolve_xref_for_properties", "tests/test_domain_py.py::test_domain_py_f...
null
true
2021-07-17T06:31:58Z
3
52
3
2,208
0
1
1
0.85
1
0.541333
94.349
56
swe_bench_verified::test::180
swe_bench_verified
test
180
django__django-15128
django/django
django/django
python
cb383753c0e0eb52306e1024d32a782549c27e61
Query.change_aliases raises an AssertionError Description Python Version: 3.9.2 Django Version: 2.2.24, 3.2.9 (reproduced using two different versions) Code to Reproduce # models.py from django.db import models class Foo(models.Model): qux = models.ForeignKey("app.Qux", on_delete=models.CASCADE, related_name="foos") ...
Thanks for the report. Reproduced at b8c0b22f2f0f8ce664642332d6d872f300c662b4. Vishal Pandey, if you're looking for pointers on how to resolve the issue I think I have a pretty good understanding of the problem. The root cause is that both queries happen to share the same alias_prefix; the letter used generate aliases ...
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py --- a/django/db/models/sql/query.py +++ b/django/db/models/sql/query.py @@ -572,6 +572,15 @@ def combine(self, rhs, connector): if self.distinct_fields != rhs.distinct_fields: raise TypeError('Cannot combine queries with di...
diff --git a/tests/queries/models.py b/tests/queries/models.py --- a/tests/queries/models.py +++ b/tests/queries/models.py @@ -613,13 +613,14 @@ def __str__(self): class BaseUser(models.Model): - pass + annotation = models.ForeignKey(Annotation, models.CASCADE, null=True, blank=True) class Task(models.M...
["test_conflicting_aliases_during_combine (queries.tests.QuerySetBitwiseOperationTests)"]
["test_ticket14729 (queries.tests.RawQueriesTests)", "test_datetimes_invalid_field (queries.tests.Queries3Tests)", "test_ticket22023 (queries.tests.Queries3Tests)", "test_ticket7107 (queries.tests.Queries3Tests)", "test_21001 (queries.tests.EmptyStringsAsNullTest)", "test_direct_exclude (queries.tests.EmptyStringsAsNul...
null
true
2021-11-25T15:50:24Z
1
28
1
2,659
0
1
1
0.85
1
0.5365
94.3345
57
swe_bench_verified::test::338
swe_bench_verified
test
338
pytest-dev__pytest-6197
pytest-dev/pytest
pytest-dev/pytest
python
e856638ba086fcf5bebf1bebea32d5cf78de87b4
Regression in 5.2.3: pytest tries to collect random __init__.py files This was caught by our build server this morning. It seems that pytest 5.2.3 tries to import any `__init__.py` file under the current directory. (We have some package that is only used on windows and cannot be imported on linux.) Here is a minimal ...
Got that one too. I suspect #5831 could be the culprit, but I didn't bisect yet. Bitten, too.. Importing `__init__.py` files early in a Django project bypasses the settings, therefore messing with any tuning that needs to happen before django models get instantiated. Yes, I have bisected and found out that #5831 is...
diff --git a/src/_pytest/python.py b/src/_pytest/python.py --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -251,21 +251,18 @@ class PyobjMixin(PyobjContext): @property def obj(self): """Underlying Python object.""" - self._mount_obj_if_needed() - return self._obj - - @obj....
diff --git a/testing/test_collection.py b/testing/test_collection.py --- a/testing/test_collection.py +++ b/testing/test_collection.py @@ -1257,3 +1257,24 @@ def test_collector_respects_tbstyle(testdir): "*= 1 error in *", ] ) + + +def test_does_not_eagerly_collect_packages(testdir): + tes...
["testing/test_collection.py::test_does_not_eagerly_collect_packages", "testing/test_collection.py::test_does_not_put_src_on_path"]
["testing/test_collection.py::TestCollector::test_collect_versus_item", "testing/test_skipping.py::test_importorskip", "testing/test_collection.py::TestCollector::test_check_equality", "testing/test_collection.py::TestCollector::test_getparent", "testing/test_collection.py::TestCollector::test_getcustomfile_roundtrip",...
null
true
2019-11-15T16:37:22Z
1
24
2
2,698
0
1
1
0.85
1
0.529667
94.314
58
swe_bench_verified::test::308
swe_bench_verified
test
308
pydata__xarray-4687
pydata/xarray
pydata/xarray
python
d3b6aa6d8b997df115a53c001d00222a0f92f63a
xr.where not preserving attributes **What happened**: Using `xr.where` on a DataArray with attributes results in a new DataArray without attributes. **What you expected to happen**: Attributes should be preserved or at least there should be a choice (e.g. pass kwargs to `apply_ufunc` so `keep_attrs=True` can be passe...
this also came up in #4141, where we proposed to work around this by using `DataArray.where` (as far as I can tell this doesn't work for you, though). There are two issues here: first of all, by default `DataArray.__eq__` removes the attributes, so without calling `xr.set_options(keep_attrs=True)` `data == 1` won't ...
diff --git a/xarray/core/computation.py b/xarray/core/computation.py --- a/xarray/core/computation.py +++ b/xarray/core/computation.py @@ -1727,7 +1727,7 @@ def dot(*arrays, dims=None, **kwargs): return result.transpose(*all_dims, missing_dims="ignore") -def where(cond, x, y): +def where(cond, x, y, keep_attrs...
diff --git a/xarray/tests/test_computation.py b/xarray/tests/test_computation.py --- a/xarray/tests/test_computation.py +++ b/xarray/tests/test_computation.py @@ -1922,6 +1922,15 @@ def test_where() -> None: assert_identical(expected, actual) +def test_where_attrs() -> None: + cond = xr.DataArray([True, Fal...
["xarray/tests/test_computation.py::test_where_attrs"]
["xarray/tests/test_computation.py::test_signature_properties", "xarray/tests/test_computation.py::test_result_name", "xarray/tests/test_computation.py::test_ordered_set_union", "xarray/tests/test_computation.py::test_ordered_set_intersection", "xarray/tests/test_computation.py::test_join_dict_keys", "xarray/tests/test...
null
true
2020-12-13T20:42:40Z
1
13
1
2,834
0
1
1
0.85
1
0.515667
94.272
59
swe_bench_verified::test::12
swe_bench_verified
test
12
astropy__astropy-14508
astropy/astropy
astropy/astropy
python
a3f4ae6cd24d5ecdf49f213d77b3513dd509a06c
`io.fits.Card` may use a string representation of floats that is larger than necessary ### Description In some scenarios, `io.fits.Card` may use a string representation of floats that is larger than necessary, which can force comments to be truncated. Due to this, there are some keyword/value/comment combinations that...
Agreed this is a bug. As far as I know, python floats by default now have reprs that use the right number of digits to be reproducible. So I think replacing this by `value_str = str(value)` should be totally fine. Do you want to try that and run the tests, to see if it works? If so, I think we should make that change ...
diff --git a/astropy/io/fits/card.py b/astropy/io/fits/card.py --- a/astropy/io/fits/card.py +++ b/astropy/io/fits/card.py @@ -1298,31 +1298,17 @@ def _format_value(value): def _format_float(value): - """Format a floating number to make sure it gets the decimal point.""" - value_str = f"{value:.16G}" - if...
diff --git a/astropy/io/fits/tests/test_header.py b/astropy/io/fits/tests/test_header.py --- a/astropy/io/fits/tests/test_header.py +++ b/astropy/io/fits/tests/test_header.py @@ -137,6 +137,27 @@ def test_floating_point_value_card(self): ): assert str(c) == _pad("FLOATNUM= -4.6737463674763E+32") ...
["astropy/io/fits/tests/test_header.py::TestHeaderFunctions::test_floating_point_string_representation_card"]
["astropy/io/fits/tests/test_header.py::test_shallow_copy", "astropy/io/fits/tests/test_header.py::test_init_with_header", "astropy/io/fits/tests/test_header.py::test_init_with_dict", "astropy/io/fits/tests/test_header.py::test_init_with_ordereddict", "astropy/io/fits/tests/test_header.py::TestHeaderFunctions::test_ren...
null
true
2023-03-09T11:08:51Z
1
24
1
2,587
0
1
1
0.85
1
0.511167
94.2585
60
swe_gym::train::1289
swe_gym
train
1,289
pandas-dev__pandas-50020
pandas-dev/pandas
pandas-dev/pandas
python
bf7960d004d2e517d1183a790bab3911792b1ed4
BUG: `pd.DateOffset` only handles `milliseconds` keyword argument if other keyword args are shorter than `day/days` ### Pandas version checks - [X] I have checked that this issue has not already been reported. - [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index...
`milliseconds` (plur) is a valid arg for `datetime.timedelta` but not for `dateutil.relativedelta.relativedelta`. E.g. `timedelta(days=1, milliseconds=1)` executes normally: so, maybe the expected behavior is to have `timedelta` handle milliseconds (plur). However, the _if-condition_ at line 315 catches anythin...
diff --git a/doc/source/whatsnew/v2.0.0.rst b/doc/source/whatsnew/v2.0.0.rst index 11185e0370e30..99ed779487c34 100644 --- a/doc/source/whatsnew/v2.0.0.rst +++ b/doc/source/whatsnew/v2.0.0.rst @@ -799,6 +799,7 @@ Datetimelike - Bug in :class:`Timestamp` was showing ``UserWarning``, which was not actionable by users, w...
diff --git a/pandas/tests/tseries/offsets/test_offsets.py b/pandas/tests/tseries/offsets/test_offsets.py index 63594c2b2c48a..135227d66d541 100644 --- a/pandas/tests/tseries/offsets/test_offsets.py +++ b/pandas/tests/tseries/offsets/test_offsets.py @@ -739,6 +739,33 @@ def test_eq(self): assert DateOffset(mi...
["pandas/tests/tseries/offsets/test_offsets.py::TestDateOffset::test_milliseconds_combination[offset_kwargs7-2023-01-01", "pandas/tests/tseries/offsets/test_offsets.py::TestDateOffset::test_milliseconds_combination[offset_kwargs5-2022-01-08", "pandas/tests/tseries/offsets/test_offsets.py::TestDateOffset::test_milliseco...
["pandas/tests/tseries/offsets/test_offsets.py::TestCommon::test_add_dt64_ndarray_non_nano[BusinessMonthBegin1-s]", "pandas/tests/tseries/offsets/test_offsets.py::TestCommon::test_add_empty_datetimeindex[CustomBusinessDay1-'-02:15']", "pandas/tests/tseries/offsets/test_offsets.py::TestCommon::test_add[CustomBusinessMon...
null
true
2022-12-02T18:06:15Z
2
85
5
3,465
0
0.85
1
0.92
1
0.783333
94.22
61
swe_bench_verified::test::326
swe_bench_verified
test
326
pylint-dev__pylint-6903
pylint-dev/pylint
pylint-dev/pylint
python
ca80f03a43bc39e4cc2c67dc99817b3c9f13b8a6
Running pylint in Kubernetes Pod with --jobs=0 fails ### Bug description I run pylint in multiple parallel stages with Jenkins at a Kubernets agent with `--jobs=0`. The newly introduced function [pylint.run._query_cpu()](https://github.com/PyCQA/pylint/blob/main/pylint/lint/run.py#L34) is called to determine the numb...
Thanks for the analysis. Would you be willing to contribute a patch? Yeah thank you @d1gl3, you did all the work, you might as well get the fix under your name 😉 (Also we implemented that in #6098, based on https://bugs.python.org/issue36054 so you can probably also add a comment there if you want) Sure, I'll patch ...
diff --git a/pylint/lint/run.py b/pylint/lint/run.py --- a/pylint/lint/run.py +++ b/pylint/lint/run.py @@ -58,6 +58,13 @@ def _query_cpu() -> int | None: cpu_shares = int(file.read().rstrip()) # For AWS, gives correct value * 1024. avail_cpu = int(cpu_shares / 1024) + + # In K8s Pods a...
diff --git a/tests/test_pylint_runners.py b/tests/test_pylint_runners.py --- a/tests/test_pylint_runners.py +++ b/tests/test_pylint_runners.py @@ -6,14 +6,17 @@ from __future__ import annotations import os +import pathlib import sys from collections.abc import Callable -from unittest.mock import patch +from unitt...
["tests/test_pylint_runners.py::test_pylint_run_jobs_equal_zero_dont_crash_with_cpu_fraction"]
["tests/test_pylint_runners.py::test_runner[run_epylint]", "tests/test_pylint_runners.py::test_runner[run_pylint]", "tests/test_pylint_runners.py::test_runner[run_pyreverse]", "tests/test_pylint_runners.py::test_runner[run_symilar]", "tests/test_pylint_runners.py::test_runner_with_arguments[run_epylint]", "tests/test_p...
null
true
2022-06-09T19:43:36Z
1
7
1
2,627
0
1
1
0.85
1
0.461167
94.1085
62
swe_bench_verified::test::257
swe_bench_verified
test
257
matplotlib__matplotlib-20826
matplotlib/matplotlib
matplotlib/matplotlib
python
a0d2e399729d36499a1924e5ca5bc067c8396810
ax.clear() adds extra ticks, un-hides shared-axis tick labels ### Bug report **Bug summary** When using shared axes (e.g. from `plt.subplots(2, 2, sharex=True, sharey=True)`), calling `ax.clear()` causes ticks and tick labels to be shown that should be hidden. The axes are still linked, though (e.g. adjusting the plo...
Thanks for the very helpful bug report. This came in #20161. @timhoffm any ideas here? (I don't know if this should block 3.4.3, but if it can be fixed it likely should be). The relevant bit of the change is [here](https://github.com/matplotlib/matplotlib/commit/2b8590c8e716bdd87e2b37801063deb7185993e8#diff-042...
diff --git a/lib/matplotlib/axis.py b/lib/matplotlib/axis.py --- a/lib/matplotlib/axis.py +++ b/lib/matplotlib/axis.py @@ -806,8 +806,13 @@ def clear(self): # Clear the callback registry for this axis, or it may "leak" self.callbacks = cbook.CallbackRegistry() - self._reset_major_tick_kw() - ...
diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py @@ -6961,6 +6961,21 @@ def test_2dcolor_plot(fig_test, fig_ref): axs[4].bar(np.arange(10), np.arange(10), color=color.reshape((1, -1))) +@check_figu...
["lib/matplotlib/tests/test_axes.py::test_shared_axes_clear[png]"]
["lib/matplotlib/tests/test_axes.py::test_get_labels", "lib/matplotlib/tests/test_axes.py::test_label_loc_vertical[png]", "lib/matplotlib/tests/test_axes.py::test_label_loc_vertical[pdf]", "lib/matplotlib/tests/test_axes.py::test_label_loc_horizontal[png]", "lib/matplotlib/tests/test_axes.py::test_label_loc_horizontal[...
null
true
2021-08-11T06:23:50Z
1
9
1
2,442
0
1
1
0.85
1
0.437
94.036
63
swe_gym::train::1355
swe_gym
train
1,355
pandas-dev__pandas-57101
pandas-dev/pandas
pandas-dev/pandas
python
9008ee5810c09bc907b5fdc36fc3c1dff4a50c55
BUG: TypeError for dataframe arithmetic combining empty and mixed type column indexes ### Pandas version checks - [X] I have checked that this issue has not already been reported. - [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas. - [ ] I hav...
In indexes/base.py: I see argsort is performed in **two conditions**. ### Condition 1: It checks if the other Index is empty then it sorts the previous / self index **example:** third (self) + first (other) self is sorted here using argsort ### Condition 2: It checks if the self Index is empty then it ...
diff --git a/doc/source/whatsnew/v2.2.1.rst b/doc/source/whatsnew/v2.2.1.rst index b9b2821ebc468..441d98e6ea106 100644 --- a/doc/source/whatsnew/v2.2.1.rst +++ b/doc/source/whatsnew/v2.2.1.rst @@ -18,6 +18,7 @@ Fixed regressions - Fixed regression in :func:`merge_ordered` raising ``TypeError`` for ``fill_method="ffill...
diff --git a/pandas/tests/reshape/merge/test_join.py b/pandas/tests/reshape/merge/test_join.py index 24e44c8f9e53e..883a50a0c1399 100644 --- a/pandas/tests/reshape/merge/test_join.py +++ b/pandas/tests/reshape/merge/test_join.py @@ -1041,6 +1041,25 @@ def test_join_empty(left_empty, how, exp): tm.assert_frame_equa...
["pandas/tests/reshape/merge/test_join.py::test_join_empty_uncomparable_columns"]
["pandas/tests/reshape/merge/test_join.py::TestJoin::test_join_on_fails_with_different_left_index", "pandas/tests/reshape/merge/test_join.py::test_join_empty[False-left-left]", "pandas/tests/reshape/merge/test_join.py::TestJoin::test_join_on[False]", "pandas/tests/reshape/merge/test_join.py::test_join_cross[a-output_co...
null
true
2024-01-27T03:30:35Z
2
66
1
3,414
0
0.85
1
0.92
1
0.72
94.03
64
swe_gym::train::2135
swe_gym
train
2,135
Project-MONAI__MONAI-5252
Project-MONAI/MONAI
project-monai/monai
python
e9f48e3416a506c0775fbe2366528ff1a30906bc
LoadImage PILReader with converter I am trying to load a PNG image. I want to ensure that at load time, the image should be single channel. I am using something like: ```py transforms = Compose([ LoadImaged(keys="image", image_only=True, reader=PILReader(converter=lambda image: image.convert("L"))), # L...
diff --git a/monai/data/image_reader.py b/monai/data/image_reader.py --- a/monai/data/image_reader.py +++ b/monai/data/image_reader.py @@ -28,7 +28,16 @@ orientation_ras_lps, ) from monai.transforms.utility.array import EnsureChannelFirst -from monai.utils import MetaKeys, SpaceKeys, deprecated, ensure_tuple, en...
diff --git a/tests/test_pil_reader.py b/tests/test_pil_reader.py --- a/tests/test_pil_reader.py +++ b/tests/test_pil_reader.py @@ -64,6 +64,7 @@ def test_converter(self, data_shape, filenames, expected_shape, meta_shape): Image.fromarray(test_image.astype("uint8")).save(filenames[i]) reade...
["tests/test_pil_reader.py::TestPNGReader::test_converter_0"]
["tests/test_pil_reader.py::TestPNGReader::test_shape_value_0", "tests/test_pil_reader.py::TestPNGReader::test_shape_value_1", "tests/test_pil_reader.py::TestPNGReader::test_shape_value_5", "tests/test_pil_reader.py::TestPNGReader::test_shape_value_3", "tests/test_pil_reader.py::TestPNGReader::test_shape_value_4", "tes...
null
true
2022-10-03T14:12:29Z
3
47
1
2,776
0
0.85
1
1
1
0.619333
94.008
65
swe_bench_verified::test::460
swe_bench_verified
test
460
sympy__sympy-17318
sympy/sympy
sympy/sympy
python
d4e0231b08147337745dcf601e62de7eefe2fb2d
sqrtdenest raises IndexError ``` >>> sqrtdenest((3 - sqrt(2)*sqrt(4 + 3*I) + 3*I)/2) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "sympy\simplify\sqrtdenest.py", line 132, in sqrtdenest z = _sqrtdenest0(expr) File "sympy\simplify\sqrtdenest.py", line 242, in _sqrtdenest0 ret...
@smichr The issue no longer exists. The above statement now gives the correct answer i.e., `I` which seems correct to me. But if there is anything to be corrected, I would like work on it. This now gives the correct answer: ```julia In [31]: sqrtdenest((3 - sqrt(2)*sqrt(4 + 3*I) + 3*I)/2) ...
diff --git a/sympy/simplify/radsimp.py b/sympy/simplify/radsimp.py --- a/sympy/simplify/radsimp.py +++ b/sympy/simplify/radsimp.py @@ -920,7 +920,7 @@ def handle(expr): def rad_rationalize(num, den): """ Rationalize num/den by removing square roots in the denominator; - num and den are sum of terms whose ...
diff --git a/sympy/simplify/tests/test_sqrtdenest.py b/sympy/simplify/tests/test_sqrtdenest.py --- a/sympy/simplify/tests/test_sqrtdenest.py +++ b/sympy/simplify/tests/test_sqrtdenest.py @@ -1,5 +1,7 @@ from sympy import sqrt, root, S, Symbol, sqrtdenest, Integral, cos from sympy.simplify.sqrtdenest import _subsets a...
["test_issue_12420"]
["test_sqrtdenest", "test_sqrtdenest2", "test_sqrtdenest_rec", "test_issue_6241", "test_sqrtdenest3", "test_sqrtdenest4", "test_sqrt_symbolic_denest", "test_issue_5857", "test_subsets", "test_issue_5653"]
null
true
2019-08-01T11:55:36Z
2
9
1
2,254
0
1
1
0.85
1
0.405667
93.942
66
swe_gym::train::577
swe_gym
train
577
python__mypy-15625
python/mypy
python/mypy
python
7f65cc7570eaa4206ae086680e1c1d0489897efa
stubgen generates an interface with invalid syntax for inheriting dataclass **Bug Report** The `stubgen` command generates an interface with invalid syntax for a data class that inherits from another class located in a different file. **To Reproduce** 1. Create a fresh virtual environment with Python `>=3.7` and ins...
@hauntsaninja maybe you can fix this one as well? It's a bummer stubgen produces files with invalid syntax. At the moment, `stubgen` doesn't seem to handle dataclasses very well in general. I've looked into this a bit. With the current master branch, if I generate stubs for this dataclass: ```python from dataclass...
diff --git a/mypy/stubgen.py b/mypy/stubgen.py --- a/mypy/stubgen.py +++ b/mypy/stubgen.py @@ -657,6 +657,7 @@ def __init__( self.defined_names: set[str] = set() # Short names of methods defined in the body of the current class self.method_names: set[str] = set() + self.processing_data...
diff --git a/mypy/test/teststubgen.py b/mypy/test/teststubgen.py --- a/mypy/test/teststubgen.py +++ b/mypy/test/teststubgen.py @@ -724,11 +724,22 @@ def run_case_inner(self, testcase: DataDrivenTestCase) -> None: def parse_flags(self, program_text: str, extra: list[str]) -> Options: flags = re.search("#...
["mypy/test/teststubgen.py::StubgenPythonSuite::stubgen.test::testDataclassInheritsFromAny_semanal", "mypy/test/teststubgen.py::StubgenPythonSuite::stubgen.test::testDataclass", "mypy/test/teststubgen.py::StubgenPythonSuite::stubgen.test::testDataclassWithKwOnlyField_semanal", "mypy/test/teststubgen.py::StubgenPythonSu...
["mypy/test/testcheck.py::TypeCheckSuite::check-dataclass-transform.test::testDataclassTransformDirectMetaclassNeitherFrozenNorNotFrozen", "mypy/test/testcheck.py::TypeCheckSuite::check-dataclasses.test::testDataclassWithSlotsConflict", "mypy/test/testcheck.py::TypeCheckSuite::check-dataclass-transform.test::testDatacl...
null
true
2023-07-08T10:05:15Z
1
57
5
3,598
0
0.85
1
0.92
1
0.69
93.94
67
swe_bench_verified::test::319
swe_bench_verified
test
319
pydata__xarray-7393
pydata/xarray
pydata/xarray
python
41fef6f1352be994cd90056d47440fe9aa4c068f
stack casts int32 dtype coordinate to int64 ### What happened? The code example below results in `False`, because the data type of the `a` coordinate is changed from 'i4' to 'i8'. ### What did you expect to happen? I expect the result to be `True`. Creating a MultiIndex should not change the data type of the Indexes...
Unfortunately this is a pandas thing, so we can't fix it. Pandas only provides `Int64Index` so everything gets cast to that. Fixing that is on the roadmap for pandas 2.0 I think (See https://github.com/pandas-dev/pandas/pull/44819#issuecomment-999790361) Darn. Well, to help this be more transparent, I think it would be...
diff --git a/xarray/core/indexing.py b/xarray/core/indexing.py --- a/xarray/core/indexing.py +++ b/xarray/core/indexing.py @@ -1531,8 +1531,12 @@ def __init__( self.level = level def __array__(self, dtype: DTypeLike = None) -> np.ndarray: + if dtype is None: + dtype = self.dtype ...
diff --git a/xarray/tests/test_indexes.py b/xarray/tests/test_indexes.py --- a/xarray/tests/test_indexes.py +++ b/xarray/tests/test_indexes.py @@ -697,3 +697,10 @@ def test_safe_cast_to_index_datetime_datetime(): actual = safe_cast_to_index(np.array(dates)) assert_array_equal(expected, actual) assert isi...
["xarray/tests/test_indexes.py::test_restore_dtype_on_multiindexes[int32]", "xarray/tests/test_indexes.py::test_restore_dtype_on_multiindexes[float32]"]
["xarray/tests/test_indexes.py::test_asarray_tuplesafe", "xarray/tests/test_indexes.py::TestIndex::test_from_variables", "xarray/tests/test_indexes.py::TestIndex::test_concat", "xarray/tests/test_indexes.py::TestIndex::test_stack", "xarray/tests/test_indexes.py::TestIndex::test_unstack", "xarray/tests/test_indexes.py::...
null
true
2022-12-20T04:34:24Z
1
6
2
2,297
0
1
1
0.85
1
0.402833
93.9335
68
swe_bench_verified::test::276
swe_bench_verified
test
276
matplotlib__matplotlib-25287
matplotlib/matplotlib
matplotlib/matplotlib
python
f8ffce6d44127d4ea7d6491262ab30046b03294b
[Bug]: offsetText is colored based on tick.color instead of tick.labelcolor ### Bug summary In version 3.6.3, when setting ytick.labelcolor / xtick.labelcolor in styles / rcParams, it does not change the color of the exponent label as well. It will be colored based on xtick.color / ytick.color. ### Code for reproduct...
Seems reasonable. @gronniger did you want to try a PR for this? Sorry, I think, right now I can not spend the time to write and test a proper PR Hi, can I work on this bug? @devRD Please do. We do not typically assign PRs, but it seems like no one else is working on it. Make sure that you add a test for it.
diff --git a/lib/matplotlib/axis.py b/lib/matplotlib/axis.py --- a/lib/matplotlib/axis.py +++ b/lib/matplotlib/axis.py @@ -2253,13 +2253,18 @@ def _init(self): ) self.label_position = 'bottom' + if mpl.rcParams['xtick.labelcolor'] == 'inherit': + tick_color = mpl.rcParams['xtick.co...
diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py @@ -7811,6 +7811,28 @@ def test_ytickcolor_is_not_yticklabelcolor(): assert tick.label1.get_color() == 'blue' +def test_xaxis_offsetText_color()...
["lib/matplotlib/tests/test_axes.py::test_xaxis_offsetText_color", "lib/matplotlib/tests/test_axes.py::test_yaxis_offsetText_color"]
["lib/matplotlib/tests/test_axes.py::test_invisible_axes[png]", "lib/matplotlib/tests/test_axes.py::test_get_labels", "lib/matplotlib/tests/test_axes.py::test_repr", "lib/matplotlib/tests/test_axes.py::test_label_loc_vertical[png]", "lib/matplotlib/tests/test_axes.py::test_label_loc_vertical[pdf]", "lib/matplotlib/test...
null
true
2023-02-22T18:19:27Z
1
15
2
2,059
0
1
1
0.85
1
0.393167
93.9045
69
swe_gym::train::1885
swe_gym
train
1,885
facebookresearch__hydra-801
facebookresearch/hydra
facebookresearch/hydra
python
90dae30eb81460ac30f19d8ad29631800d35aea8
[Bug] Can't use overrides containing an asterisk # 🐛 Bug It seems like it is not possible to use an override that contains an asterisk. The lexer generates a token recognition error. I didn't dig into the grammar to understand why though. ## To reproduce ``` import hydra @hydra.main() def foo(): pass foo() `...
Thanks for reporting. 1. There is an issue with the error itself. 2. I will see if I can include * in the valid character for value, probably doable. 3. For now, you can quote the *. See example below. Note that the shell interprets the outer quotes: ```shell "+foo='*'" ```
diff --git a/hydra/_internal/utils.py b/hydra/_internal/utils.py --- a/hydra/_internal/utils.py +++ b/hydra/_internal/utils.py @@ -27,7 +27,11 @@ from hydra._internal.config_search_path_impl import ConfigSearchPathImpl from hydra.core.config_search_path import ConfigSearchPath from hydra.core.utils import get_valid_...
diff --git a/tests/test_config_loader.py b/tests/test_config_loader.py --- a/tests/test_config_loader.py +++ b/tests/test_config_loader.py @@ -1002,7 +1002,7 @@ def test_complex_defaults(overrides: Any, expected: Any) -> None: ["db"], pytest.raises( HydraException, - ...
["tests/test_config_loader.py::test_apply_overrides_to_defaults[syntax_error0]"]
["tests/test_config_loader.py::TestConfigLoader::test_load_with_missing_default[pkg]", "tests/test_config_loader.py::test_complex_defaults[overrides0-expected0]", "tests/test_config_loader.py::TestConfigLoader::test_load_history[pkg]", "tests/test_overrides_parser.py::test_primitive[primitive:str_interpolation-none-non...
null
true
2020-07-20T23:34:28Z
3
52
1
4,694
0
0.85
1
0.92
1
0.673333
93.89
70
swe_bench_verified::test::194
swe_bench_verified
test
194
django__django-15503
django/django
django/django
python
859a87d873ce7152af73ab851653b4e1c3ffea4c
has_key, has_keys, and has_any_keys JSONField() lookups don't handle numeric keys on SQLite, MySQL, and Oracle. Description (last modified by TheTerrasque) Problem When using models.​JSONField() ​has_key lookup with numerical keys on SQLite database it fails to find the keys. Versions: Django: 4.0.3 Python: 3.9.6 (...
Duplicate of #30566, see comment. Not a duplicate of #30566 This is django's models.JSONField() not postgres extension JSONField It works as expected on Postgresql, the bug is on SQLite #30566 goes directly against comments for https://code.djangoproject.com/ticket/29504 If different behavior is expected on SQLite (or ...
diff --git a/django/db/models/fields/json.py b/django/db/models/fields/json.py --- a/django/db/models/fields/json.py +++ b/django/db/models/fields/json.py @@ -172,6 +172,10 @@ def as_sql(self, compiler, connection): class HasKeyLookup(PostgresOperatorLookup): logical_operator = None + def compile_json_path_f...
diff --git a/tests/model_fields/test_jsonfield.py b/tests/model_fields/test_jsonfield.py --- a/tests/model_fields/test_jsonfield.py +++ b/tests/model_fields/test_jsonfield.py @@ -576,6 +576,33 @@ def test_has_any_keys(self): [self.objs[3], self.objs[4], self.objs[6]], ) + def test_has_key_num...
["test_has_key_number (model_fields.test_jsonfield.TestQuerying)", "test_has_keys (model_fields.test_jsonfield.TestQuerying)"]
["test_formfield (model_fields.test_jsonfield.TestFormField)", "test_formfield_custom_encoder_decoder (model_fields.test_jsonfield.TestFormField)", "test_custom_encoder (model_fields.test_jsonfield.TestValidation)", "test_invalid_decoder (model_fields.test_jsonfield.TestValidation)", "test_invalid_encoder (model_fields...
null
true
2022-03-12T06:22:37Z
1
26
2
1,790
0
1
1
0.85
1
0.385
93.88
71
swe_bench_verified::test::218
swe_bench_verified
test
218
django__django-16136
django/django
django/django
python
19e6efa50b603af325e7f62058364f278596758f
object HttpResponseNotAllowed can't be used in 'await' expression Description When defining a simple View subclass with only an async "post" method, GET requests to this view cause the following exception: [29/Sep/2022 07:50:48] "GET /demo HTTP/1.1" 500 81134 Method Not Allowed (GET): /demo Internal Server Error: /dem...
Yes, looks right. http_method_not_allowed() needs to be adjusted to handle both sync and async cases in the same way as options() Do you have capacity to do a patch quickly? (Otherwise I'll take it on.) Thanks for the report! Regression in 9ffd4eae2ce7a7100c98f681e2b6ab818df384a4. Thank you very much for your confirmat...
diff --git a/django/views/generic/base.py b/django/views/generic/base.py --- a/django/views/generic/base.py +++ b/django/views/generic/base.py @@ -148,7 +148,16 @@ def http_method_not_allowed(self, request, *args, **kwargs): request.path, extra={"status_code": 405, "request": request}, ...
diff --git a/tests/async/tests.py b/tests/async/tests.py --- a/tests/async/tests.py +++ b/tests/async/tests.py @@ -6,8 +6,8 @@ from django.core.cache import DEFAULT_CACHE_ALIAS, caches from django.core.exceptions import ImproperlyConfigured, SynchronousOnlyOperation -from django.http import HttpResponse -from djang...
["test_http_method_not_allowed_responds_correctly (async.tests.ViewTests)", "test_mixed_views_raise_error (async.tests.ViewTests)"]
["View and by extension any subclasses that don't define handlers are", "test_options_handler_responds_correctly (async.tests.ViewTests)", "test_views_are_correctly_marked (async.tests.ViewTests)", "test_caches_local (async.tests.CacheTest)", "test_async_unsafe (async.tests.AsyncUnsafeTest)", "Utility class which turns...
null
true
2022-09-29T11:47:50Z
1
11
2
2,085
0
1
1
0.85
1
0.384167
93.8775
72
swe_gym::train::10
swe_gym
train
10
getmoto__moto-5725
getmoto/moto
getmoto/moto
python
b4f0fb7137bdcb5b78d928d2ed1e751e9e1b2bdc
Route53 should raise an exception when record already exists Hi, I'm trying to mock route53 and test my function, however, I noticed that moto does not raise an exception that real route53 does. This does apply for CREATE and DELETE actions maybe even for UPSERT moto version = 3.1.4 ## How to reproduce Call `route53_...
Thanks for raising this @1oglop1 - will mark it as an enhancement to implement this validation.
diff --git a/moto/route53/exceptions.py b/moto/route53/exceptions.py --- a/moto/route53/exceptions.py +++ b/moto/route53/exceptions.py @@ -162,3 +162,20 @@ class NoSuchDelegationSet(Route53ClientError): def __init__(self, delegation_set_id): super().__init__("NoSuchDelegationSet", delegation_set_id) ...
diff --git a/tests/test_route53/test_route53.py b/tests/test_route53/test_route53.py --- a/tests/test_route53/test_route53.py +++ b/tests/test_route53/test_route53.py @@ -1118,6 +1118,37 @@ def test_change_resource_record_invalid_action_value(): len(response["ResourceRecordSets"]).should.equal(1) +@mock_route5...
["tests/test_route53/test_route53.py::test_change_resource_record_set_twice"]
["tests/test_route53/test_route53.py::test_update_hosted_zone_comment", "tests/test_route53/test_route53.py::test_use_health_check_in_resource_record_set", "tests/test_route53/test_route53.py::test_get_dns_sec", "tests/test_route53/test_route53.py::test_get_unknown_hosted_zone", "tests/test_route53/test_route53.py::tes...
null
true
2022-11-30 21:13:44
3
44
1
3,370
0
0.85
1
0.92
1
0.646667
93.81
73
swe_bench_verified::test::349
swe_bench_verified
test
349
scikit-learn__scikit-learn-10297
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
b90661d6a46aa3619d3eec94d5281f5888add501
linear_model.RidgeClassifierCV's Parameter store_cv_values issue #### Description Parameter store_cv_values error on sklearn.linear_model.RidgeClassifierCV #### Steps/Code to Reproduce import numpy as np from sklearn import linear_model as lm #test database n = 100 x = np.random.randn(n, 30) y = np.random.normal(size...
thanks for the report. PR welcome. Can I give it a try? sure, thanks! please make the change and add a test in your pull request Can I take this? Thanks for the PR! LGTM @MechCoder review and merge? I suppose this should include a brief test... Indeed, please @yurii-andrieiev add a quick test to check that set...
diff --git a/sklearn/linear_model/ridge.py b/sklearn/linear_model/ridge.py --- a/sklearn/linear_model/ridge.py +++ b/sklearn/linear_model/ridge.py @@ -1212,18 +1212,18 @@ class RidgeCV(_BaseRidgeCV, RegressorMixin): store_cv_values : boolean, default=False Flag indicating if the cross-validation values ...
diff --git a/sklearn/linear_model/tests/test_ridge.py b/sklearn/linear_model/tests/test_ridge.py --- a/sklearn/linear_model/tests/test_ridge.py +++ b/sklearn/linear_model/tests/test_ridge.py @@ -575,8 +575,7 @@ def test_class_weights_cv(): def test_ridgecv_store_cv_values(): - # Test _RidgeCV's store_cv_values ...
["sklearn/linear_model/tests/test_ridge.py::test_ridge_classifier_cv_store_cv_values"]
["sklearn/linear_model/tests/test_ridge.py::test_ridge", "sklearn/linear_model/tests/test_ridge.py::test_primal_dual_relationship", "sklearn/linear_model/tests/test_ridge.py::test_ridge_singular", "sklearn/linear_model/tests/test_ridge.py::test_ridge_regression_sample_weights", "sklearn/linear_model/tests/test_ridge.py...
null
true
2017-12-12T22:07:47Z
1
34
1
1,484
0
1
1
0.85
1
0.360667
93.807
74
swe_gym::train::1356
swe_gym
train
1,356
pandas-dev__pandas-56769
pandas-dev/pandas
pandas-dev/pandas
python
7d61e32bb05762c97c978ebfaf59063b81ab9db7
BUG: DataFrame.replace() is inconsistent between `float64` and `Float64` ### Pandas version checks - [X] I have checked that this issue has not already been reported. - [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas. - [ ] I have confirmed t...
>pd.DataFrame({"a": [0, 1, 2]}, dtype="Float64").replace({1: "A"}) In regards to this please see here: https://github.com/pandas-dev/pandas/blob/a76b3f4c73a351a11d2cae6236773192e630d4f5/pandas/core/array_algos/putmask.py#L29-L59 I guess I'm trying to understand where you would be using Float points as `Boolean` ...
diff --git a/doc/source/whatsnew/v2.2.0.rst b/doc/source/whatsnew/v2.2.0.rst index 0b04a1d313a6d..6cac4bcdfa045 100644 --- a/doc/source/whatsnew/v2.2.0.rst +++ b/doc/source/whatsnew/v2.2.0.rst @@ -789,6 +789,7 @@ Numeric - Bug in :meth:`Series.__floordiv__` and :meth:`Series.__truediv__` for :class:`ArrowDtype` with i...
diff --git a/pandas/tests/series/methods/test_replace.py b/pandas/tests/series/methods/test_replace.py index 4330153c186ca..b0f4e233ba5eb 100644 --- a/pandas/tests/series/methods/test_replace.py +++ b/pandas/tests/series/methods/test_replace.py @@ -799,3 +799,15 @@ def test_replace_numeric_column_with_na(self, val): ...
["pandas/tests/series/methods/test_replace.py::TestSeriesReplace::test_replace_ea_float_with_bool"]
["pandas/tests/series/methods/test_replace.py::TestSeriesReplace::test_replace_nat_with_tz", "pandas/tests/series/methods/test_replace.py::TestSeriesReplace::test_replace_cascade[False]", "pandas/tests/series/methods/test_replace.py::TestSeriesReplace::test_replace_commutative[ser0-to_replace0-exp0]", "pandas/tests/ser...
null
true
2024-01-07T19:36:32Z
2
43
1
3,683
0
0.85
1
0.92
1
0.643333
93.8
75
swe_gym::train::1328
swe_gym
train
1,328
pandas-dev__pandas-50760
pandas-dev/pandas
pandas-dev/pandas
python
d3f0e9a95d220cd349fbc2d9b107ebebc5d7b58a
BUG: pd.DataFrame.replace integer/float value to pd.NA causes RecursionError ### Pandas version checks - [X] I have checked that this issue has not already been reported. - [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas. - [X] I have confirm...
diff --git a/doc/source/whatsnew/v2.0.0.rst b/doc/source/whatsnew/v2.0.0.rst index 033f47f0c994d..f734db1419282 100644 --- a/doc/source/whatsnew/v2.0.0.rst +++ b/doc/source/whatsnew/v2.0.0.rst @@ -980,6 +980,8 @@ Missing - Bug in :meth:`Series.map` caused incorrect result when data has NaNs and defaultdict mapping was...
diff --git a/pandas/tests/series/methods/test_replace.py b/pandas/tests/series/methods/test_replace.py index 1188c9452520c..44c224c120ea6 100644 --- a/pandas/tests/series/methods/test_replace.py +++ b/pandas/tests/series/methods/test_replace.py @@ -690,3 +690,25 @@ def test_replace_change_dtype_series(self): d...
["pandas/tests/series/methods/test_replace.py::TestSeriesReplace::test_replace_na_in_obj_column[object]", "pandas/tests/series/methods/test_replace.py::TestSeriesReplace::test_replace_numeric_column_with_na[0]", "pandas/tests/series/methods/test_replace.py::TestSeriesReplace::test_replace_numeric_column_with_na[0.5]"]
["pandas/tests/series/methods/test_replace.py::TestSeriesReplace::test_replace_nat_with_tz", "pandas/tests/series/methods/test_replace.py::TestSeriesReplace::test_replace_commutative[ser0-to_replace0-exp0]", "pandas/tests/series/methods/test_replace.py::TestSeriesReplace::test_replace_nullable_numeric", "pandas/tests/s...
null
true
2023-01-15T17:00:10Z
3
25
3
2,690
0
0.85
1
1
1
0.531667
93.745
76
swe_bench_verified::test::401
swe_bench_verified
test
401
sphinx-doc__sphinx-8265
sphinx-doc/sphinx
sphinx-doc/sphinx
python
b428cd2404675475a5c3dc2a2b0790ba57676202
docstring default arg is broken **Describe the bug** docstring default arg is broken in html. Python class method > def add_lines(self, lines, color=(1, 1, 1), width=5, label=None, name=None): is rendered as > add_lines(lines, color=1, 1, 1, width=5, label=None, name=None) **To Reproduce** Steps to reproduce th...
Thank you for reporting. This is related to https://github.com/sphinx-doc/sphinx/issues/7498.
diff --git a/sphinx/pycode/ast.py b/sphinx/pycode/ast.py --- a/sphinx/pycode/ast.py +++ b/sphinx/pycode/ast.py @@ -166,14 +166,28 @@ def visit_Set(self, node: ast.Set) -> str: return "{" + ", ".join(self.visit(e) for e in node.elts) + "}" def visit_Subscript(self, node: ast.Subscript) -> str: - r...
diff --git a/tests/test_pycode_ast.py b/tests/test_pycode_ast.py --- a/tests/test_pycode_ast.py +++ b/tests/test_pycode_ast.py @@ -53,7 +53,7 @@ ("+ a", "+ a"), # UAdd ("- 1", "- 1"), # UnaryOp ("- a", "- a"), # USub - ...
["tests/test_pycode_ast.py::test_unparse[(1,"]
["tests/test_pycode_ast.py::test_unparse[a", "tests/test_pycode_ast.py::test_unparse[os.path-os.path]", "tests/test_pycode_ast.py::test_unparse[1", "tests/test_pycode_ast.py::test_unparse[b'bytes'-b'bytes']", "tests/test_pycode_ast.py::test_unparse[object()-object()]", "tests/test_pycode_ast.py::test_unparse[1234-1234_...
null
true
2020-10-03T03:06:00Z
1
18
1
1,673
0
1
1
0.85
1
0.338833
93.7415
77
swe_bench_verified::test::387
swe_bench_verified
test
387
sphinx-doc__sphinx-11445
sphinx-doc/sphinx
sphinx-doc/sphinx
python
71db08c05197545944949d5aa76cd340e7143627
Using rst_prolog removes top level headings containing a domain directive ### Describe the bug If `rst_prolog` is set, then any documents that contain a domain directive as the first heading (eg `:mod:`) do not render the heading correctly or include the heading in the toctree. In the example below, if the heading of...
I think we can fix this by just adding an empty line after the RST prolog internally. IIRC, the prolog is just prepended directly to the RST string given to the RST parser. After investigation, the issue is that the prolog is inserted between <code>:mod:\`...\`</code> and the header definnition but does not check that ...
diff --git a/sphinx/util/rst.py b/sphinx/util/rst.py --- a/sphinx/util/rst.py +++ b/sphinx/util/rst.py @@ -10,22 +10,17 @@ from docutils.parsers.rst import roles from docutils.parsers.rst.languages import en as english +from docutils.parsers.rst.states import Body from docutils.statemachine import StringList from...
diff --git a/tests/test_util_rst.py b/tests/test_util_rst.py --- a/tests/test_util_rst.py +++ b/tests/test_util_rst.py @@ -78,6 +78,61 @@ def test_prepend_prolog_without_CR(app): ('dummy.rst', 1, 'Sphinx is a document generator')] +def test_prepend_prolog_with_roles_in_section...
["tests/test_util_rst.py::test_prepend_prolog_with_roles_in_sections_with_newline", "tests/test_util_rst.py::test_prepend_prolog_with_roles_in_sections_without_newline"]
["tests/test_util_rst.py::test_escape", "tests/test_util_rst.py::test_append_epilog", "tests/test_util_rst.py::test_prepend_prolog", "tests/test_util_rst.py::test_prepend_prolog_with_CR", "tests/test_util_rst.py::test_prepend_prolog_without_CR", "tests/test_util_rst.py::test_prepend_prolog_with_roles_in_sections", "tes...
null
true
2023-05-28T19:15:07Z
1
14
2
1,723
0
1
1
0.85
1
0.333833
93.7265
78
swe_bench_verified::test::209
swe_bench_verified
test
209
django__django-15916
django/django
django/django
python
88e67a54b7ed0210c11523a337b498aadb2f5187
Allow ModelForm meta to specify formfield_callback. Description (last modified by Klaas-Jan Gorter) The function django.forms.modelform_factory returns a form class based on the class it recieves as form argument. As an additional argument it accepts a formfield_callback function. When no callback is provided the c...
I was always the impression that formfield_callback was solely an allowed kwarg of the modelform_factory function and its friends. I believe this test has been removed from version 2, because I find no equivalent test in tests/model_formsets_regress. From what I can see the patch from #18573 was never committed and thu...
diff --git a/django/forms/models.py b/django/forms/models.py --- a/django/forms/models.py +++ b/django/forms/models.py @@ -253,18 +253,11 @@ def __init__(self, options=None): self.help_texts = getattr(options, "help_texts", None) self.error_messages = getattr(options, "error_messages", None) ...
diff --git a/tests/model_forms/tests.py b/tests/model_forms/tests.py --- a/tests/model_forms/tests.py +++ b/tests/model_forms/tests.py @@ -3496,6 +3496,41 @@ class InheritedForm(NewForm): type(NewForm.base_fields[name].widget), ) + def test_custom_callback_in_meta(self): + def ...
["test_custom_callback_from_base_form_meta (model_forms.tests.FormFieldCallbackTests)", "test_custom_callback_in_meta (model_forms.tests.FormFieldCallbackTests)"]
["test_modelform_factory_metaclass (model_forms.tests.CustomMetaclassTestCase)", "Regression test for #12960. Make sure the cleaned_data returned from", "Regression for #12596: Calling super from ModelForm.clean() should be", "test_bad_callback (model_forms.tests.FormFieldCallbackTests)", "Using base forms with widgets...
null
true
2022-08-04T18:59:18Z
1
13
2
1,738
0
1
1
0.85
1
0.333
93.724
79
swe_bench_verified::test::108
swe_bench_verified
test
108
django__django-13344
django/django
django/django
python
e39e727ded673e74016b5d3658d23cbe20234d11
Coroutine passed to the first middleware's process_response() instead of HttpResponse. Description Like the title says, using ASGI (+ uvicorn in my case), the first middleware (according to the list in settings.py) receives a coroutine as its response parameter, while all other middlewares down the line receive a djan...
Tentatively accepted for investigation. It's not about the first middleware because if you have only one it gets HttpResponse, but if you have at least two then then the first in a chain gets coroutine. Andrew, Can you take a look? I think it's a bug in SecurityMiddleware : its __init__ does not call super().__init__()...
diff --git a/django/contrib/sessions/middleware.py b/django/contrib/sessions/middleware.py --- a/django/contrib/sessions/middleware.py +++ b/django/contrib/sessions/middleware.py @@ -13,9 +13,7 @@ class SessionMiddleware(MiddlewareMixin): # RemovedInDjango40Warning: when the deprecation ends, replace with: # ...
diff --git a/tests/cache/tests.py b/tests/cache/tests.py --- a/tests/cache/tests.py +++ b/tests/cache/tests.py @@ -2083,6 +2083,7 @@ def test_constructor(self): self.assertEqual(middleware.cache_timeout, 30) self.assertEqual(middleware.key_prefix, 'middlewareprefix') self.assertEqual(middlewa...
["test_coroutine (deprecation.test_middleware_mixin.MiddlewareMixinTests)", "test_deprecation (deprecation.test_middleware_mixin.MiddlewareMixinTests)"]
["Nonexistent cache keys return as None/default.", "set_many() returns an empty list when all keys are inserted.", "test_createcachetable_observes_database_router (cache.tests.CreateCacheTableForDBCacheTests)", "test_per_thread (cache.tests.CacheHandlerTest)", "test_same_instance (cache.tests.CacheHandlerTest)", "If No...
null
true
2020-08-24T20:50:35Z
3
32
2
1,358
0
1
1
0.85
1
0.333
93.724
80
swe_bench_verified::test::400
swe_bench_verified
test
400
sphinx-doc__sphinx-8120
sphinx-doc/sphinx
sphinx-doc/sphinx
python
795747bdb6b8fb7d717d5bbfc2c3316869e66a73
locale/<language>/LC_MESSAGES/sphinx.po translation ignored **Describe the bug** I read [1] as it should be possible to add a file ``locale/<language>/LC_MESSAGES/sphinx.mo`` to the source dir (same dir as the ``Makefile``) and through that change translations or add additional translation to <language>. When I add ``...
So I found a work around or "proved" to myself that I didn't read the instructions completely wrong. If I just change ``language='da'`` to ``language='en'`` in ``conf.py`` and rename ``locale/da/`` to ``locale/en/`` it works as expected. My few select changes to the translation of internal messages are show. ``` $ g...
diff --git a/sphinx/application.py b/sphinx/application.py --- a/sphinx/application.py +++ b/sphinx/application.py @@ -18,7 +18,7 @@ from collections import deque from io import StringIO from os import path -from typing import Any, Callable, Dict, IO, List, Tuple, Union +from typing import Any, Callable, Dict, IO, L...
diff --git a/tests/test_intl.py b/tests/test_intl.py --- a/tests/test_intl.py +++ b/tests/test_intl.py @@ -14,8 +14,10 @@ import pytest from babel.messages import pofile, mofile +from babel.messages.catalog import Catalog from docutils import nodes +from sphinx import locale from sphinx.testing.util import ( ...
["tests/test_intl.py::test_customize_system_message"]
["tests/test_intl.py::test_text_toctree", "tests/test_intl.py::test_text_emit_warnings", "tests/test_intl.py::test_text_warning_node", "tests/test_intl.py::test_text_title_underline", "tests/test_intl.py::test_text_subdirs", "tests/test_intl.py::test_text_inconsistency_warnings", "tests/test_intl.py::test_text_literalb...
null
true
2020-08-14T07:23:34Z
2
9
1
1,815
0
1
1
0.85
1
0.3325
93.7225
81
swe_gym::train::1209
swe_gym
train
1,209
pandas-dev__pandas-48734
pandas-dev/pandas
pandas-dev/pandas
python
c2fade19bbf275f1fe5022f1c9ded387e52a3921
BUG: DataFrame.plot(kind='scatter') does not raise KeyError when unknown colormap is applied ### Pandas version checks - [X] I have checked that this issue has not already been reported. - [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas. - [ ...
diff --git a/doc/source/whatsnew/v1.5.1.rst b/doc/source/whatsnew/v1.5.1.rst index 3f4265245bcb6..0f71814341aba 100644 --- a/doc/source/whatsnew/v1.5.1.rst +++ b/doc/source/whatsnew/v1.5.1.rst @@ -16,6 +16,7 @@ Fixed regressions ~~~~~~~~~~~~~~~~~ - Fixed Regression in :meth:`DataFrame.loc` when setting values as a :c...
diff --git a/pandas/tests/plotting/frame/test_frame.py b/pandas/tests/plotting/frame/test_frame.py index 78116ead70cd4..06e04f06c38d1 100644 --- a/pandas/tests/plotting/frame/test_frame.py +++ b/pandas/tests/plotting/frame/test_frame.py @@ -1681,6 +1681,12 @@ def _check_errorbar_color(containers, expected, has_err="has...
["pandas/tests/plotting/frame/test_frame.py::TestDataFramePlots::test_scatter_unknown_colormap"]
["pandas/tests/plotting/frame/test_frame.py::TestDataFramePlots::test_line_area_stacked[line]", "pandas/tests/plotting/frame/test_frame.py::TestDataFramePlots::test_bad_label", "pandas/tests/plotting/frame/test_frame.py::TestDataFramePlots::test_xcompat", "pandas/tests/plotting/frame/test_frame.py::TestDataFramePlots::...
null
true
2022-09-23T13:17:46Z
2
21
1
2,681
0
0.85
1
1
1
0.516833
93.7005
82
swe_gym::train::1418
swe_gym
train
1,418
pandas-dev__pandas-48637
pandas-dev/pandas
pandas-dev/pandas
python
38271a4a9a9a91f6683c0e4bbdc1eff612a6b988
BUG: TypeError when printing dataframe with numpy.record dtype column ### Pandas version checks - [X] I have checked that this issue has not already been reported. - [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas. - [X] I have confirmed this...
I gave that a check and I think the reason why the list comprehension is working and the other approach not is that in the former case we have dtype list and in the later case a dtype np.recarray. When having a look into `pandas/core/dtypes/missing.py`, we see in line 172-173 an `_isna_array` check where the `obj` is g...
diff --git a/doc/source/whatsnew/v2.1.0.rst b/doc/source/whatsnew/v2.1.0.rst index 22a2931519ffd..4180cdb245a82 100644 --- a/doc/source/whatsnew/v2.1.0.rst +++ b/doc/source/whatsnew/v2.1.0.rst @@ -316,6 +316,7 @@ Conversion ^^^^^^^^^^ - Bug in :func:`DataFrame.style.to_latex` and :func:`DataFrame.style.to_html` if th...
diff --git a/pandas/tests/frame/test_repr_info.py b/pandas/tests/frame/test_repr_info.py index 66d8084abea68..b42af8cdfcd8c 100644 --- a/pandas/tests/frame/test_repr_info.py +++ b/pandas/tests/frame/test_repr_info.py @@ -361,6 +361,71 @@ def test_datetime64tz_slice_non_truncate(self): result = repr(df) ...
["pandas/tests/frame/test_repr_info.py::TestDataFrameReprInfoEtc::test_to_records_with_na_record_value", "pandas/tests/frame/test_repr_info.py::TestDataFrameReprInfoEtc::test_to_records_with_na_record", "pandas/tests/frame/test_repr_info.py::TestDataFrameReprInfoEtc::test_to_records_with_inf_record", "pandas/tests/fram...
["pandas/tests/frame/test_repr_info.py::TestDataFrameReprInfoEtc::test_repr_mixed", "pandas/tests/frame/test_repr_info.py::TestDataFrameReprInfoEtc::test_assign_index_sequences", "pandas/tests/frame/test_repr_info.py::TestDataFrameReprInfoEtc::test_to_string_ea_na_in_multiindex", "pandas/tests/frame/test_repr_info.py::...
null
true
2022-09-19T10:03:21Z
2
32
5
5,654
0
0.85
1
0.92
1
0.606667
93.69
83
swe_gym::train::332
swe_gym
train
332
getmoto__moto-6204
getmoto/moto
getmoto/moto
python
dda6e573dde5440612c3bab17247a4544c680b23
stepfunctions does not respect the flag `SF_EXECUTION_HISTORY_TYPE` across all API's # Reasoning: I am trying to use Moto to replicate a failed step function by providing a definition with just a failed state. # How I found the error: - Originally as the docs are sparse, I thought that moto might parse the definition ...
Thanks for raising this @bfbenf - marking it as an enhancement to ensure setting this environment variable results in the same behaviour across all three features
diff --git a/moto/stepfunctions/models.py b/moto/stepfunctions/models.py --- a/moto/stepfunctions/models.py +++ b/moto/stepfunctions/models.py @@ -230,7 +230,11 @@ def __init__( self.start_date = iso_8601_datetime_with_milliseconds(datetime.now()) self.state_machine_arn = state_machine_arn se...
diff --git a/tests/test_stepfunctions/test_stepfunctions.py b/tests/test_stepfunctions/test_stepfunctions.py --- a/tests/test_stepfunctions/test_stepfunctions.py +++ b/tests/test_stepfunctions/test_stepfunctions.py @@ -950,6 +950,12 @@ def test_state_machine_get_execution_history_contains_expected_failure_events_wh ...
["tests/test_stepfunctions/test_stepfunctions.py::test_state_machine_get_execution_history_contains_expected_failure_events_when_started"]
["tests/test_stepfunctions/test_stepfunctions.py::test_state_machine_describe_execution_with_no_input", "tests/test_stepfunctions/test_stepfunctions.py::test_state_machine_untagging_non_existent_resource_fails", "tests/test_stepfunctions/test_stepfunctions.py::test_state_machine_start_execution_fails_on_duplicate_execu...
null
true
2023-04-11 22:41:45
1
30
1
5,427
0
0.85
1
0.92
1
0.6
93.67
84
swe_gym::train::2098
swe_gym
train
2,098
Project-MONAI__MONAI-6446
Project-MONAI/MONAI
project-monai/monai
python
4219e0f010f17d01fc08b2cd7e4c78fe1e17ab61
MLflow handler get wrong when running two run without name **Describe the bug** [This line](https://github.com/Project-MONAI/MONAI/blob/3d612588aed31e0c7aabe961b66406d6fea17343/monai/handlers/mlflow_handler.py#L193) in the MLFlowHandler with the `or not self.run_name` logic will lead to a bug. When running two bundles ...
Hi @binliunls , What do you mean "running two bundles"? You run 2 bundles in parallel with multi-thread? Or just run 2 bundles one by one? If one by one, I think we should set `close_on_complete=True`? Does it work? Thanks. > Hi @binliunls , > > What do you mean "running two bundles"? You run 2 bundles in pa...
diff --git a/monai/handlers/mlflow_handler.py b/monai/handlers/mlflow_handler.py --- a/monai/handlers/mlflow_handler.py +++ b/monai/handlers/mlflow_handler.py @@ -23,8 +23,10 @@ from monai.utils import ensure_tuple, min_version, optional_import Events, _ = optional_import("ignite.engine", IgniteInfo.OPT_IMPORT_VERS...
diff --git a/tests/test_auto3dseg_bundlegen.py b/tests/test_auto3dseg_bundlegen.py --- a/tests/test_auto3dseg_bundlegen.py +++ b/tests/test_auto3dseg_bundlegen.py @@ -25,7 +25,13 @@ from monai.bundle.config_parser import ConfigParser from monai.data import create_test_image_3d from monai.utils import set_determinism...
["tests/test_handler_mlflow.py::TestHandlerMLFlow::test_multi_run"]
["tests/test_handler_mlflow.py::TestHandlerMLFlow::test_metrics_track_iters_mock_1", "tests/test_handler_mlflow.py::TestHandlerMLFlow::test_multi_thread", "tests/test_handler_mlflow.py::TestHandlerMLFlow::test_metrics_track_mock_0", "tests/test_handler_mlflow.py::TestHandlerMLFlow::test_metrics_track", "tests/test_hand...
null
true
2023-04-27T14:33:38Z
1
28
1
5,142
0
0.85
1
0.92
1
0.593333
93.65
85
swe_gym::train::1524
swe_gym
train
1,524
pandas-dev__pandas-50056
pandas-dev/pandas
pandas-dev/pandas
python
80b3feea900e97c8184761c8835cd79fd8bdd465
BUG: read_csv with engine pyarrow doesn't handle parsing multiple date columns ### Pandas version checks - [X] I have checked that this issue has not already been reported. - [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas. - [X] I have confi...
Looks like ``` pandas/tests/io/parser/test_parse_dates.py::test_multiple_date_col_timestamp_parse ``` is already marked as `xfail_pyarrow`
diff --git a/doc/source/whatsnew/v2.1.0.rst b/doc/source/whatsnew/v2.1.0.rst index e1ac9e3309de7..67f5484044cd5 100644 --- a/doc/source/whatsnew/v2.1.0.rst +++ b/doc/source/whatsnew/v2.1.0.rst @@ -386,6 +386,7 @@ I/O - :meth:`DataFrame.to_orc` now raising ``ValueError`` when non-default :class:`Index` is given (:issue...
diff --git a/pandas/tests/io/parser/test_parse_dates.py b/pandas/tests/io/parser/test_parse_dates.py index 81de4f13de81d..b354f7d9da94d 100644 --- a/pandas/tests/io/parser/test_parse_dates.py +++ b/pandas/tests/io/parser/test_parse_dates.py @@ -139,9 +139,8 @@ def test_separator_date_conflict(all_parsers): tm.asse...
["pandas/tests/io/parser/test_parse_dates.py::test_parse_dates_infer_datetime_format_warning[pyarrow-read_table_check_warnings]", "pandas/tests/io/parser/test_parse_dates.py::test_bad_date_parse[pyarrow--True]", "pandas/tests/io/parser/test_parse_dates.py::test_multiple_date_col_custom[pyarrow-False]", "pandas/tests/io...
["pandas/tests/io/parser/test_parse_dates.py::test_read_with_parse_dates_invalid_type[python-parse_dates0]", "pandas/tests/io/parser/test_parse_dates.py::test_missing_parse_dates_column_raises[c_low-None-usecols1-parse_dates1-time]", "pandas/tests/io/parser/test_parse_dates.py::test_multiple_date_cols_index[c_high-pars...
null
true
2022-12-04T16:23:37Z
3
28
27
4,538
0
0.85
1
0.92
1
0.593333
93.65
86
swe_bench_verified::test::255
swe_bench_verified
test
255
matplotlib__matplotlib-20488
matplotlib/matplotlib
matplotlib/matplotlib
python
b7ce415c15eb39b026a097a2865da73fbcf15c9c
test_huge_range_log is failing... ### Bug report `lib/matplotlib/tests/test_image.py::test_huge_range_log` is failing quite a few of the CI runs with a Value Error. I cannot reproduce locally, so I assume there was a numpy change somewhere... This test came in #18458 ``` lib/matplotlib/image.py:638: in draw im...
Yeah, OK, np 1.21.0 dropped 8hr ago...
diff --git a/lib/matplotlib/image.py b/lib/matplotlib/image.py --- a/lib/matplotlib/image.py +++ b/lib/matplotlib/image.py @@ -532,9 +532,9 @@ def _make_image(self, A, in_bbox, out_bbox, clip_bbox, magnification=1.0, # we have re-set the vmin/vmax to account for small errors # that may...
diff --git a/lib/matplotlib/tests/test_image.py b/lib/matplotlib/tests/test_image.py --- a/lib/matplotlib/tests/test_image.py +++ b/lib/matplotlib/tests/test_image.py @@ -1233,23 +1233,24 @@ def test_imshow_quantitynd(): fig.canvas.draw() +@pytest.mark.parametrize('x', [-1, 1]) @check_figures_equal(extensions...
["lib/matplotlib/tests/test_image.py::test_huge_range_log[png--1]"]
["lib/matplotlib/tests/test_image.py::test_image_interps[png]", "lib/matplotlib/tests/test_image.py::test_image_interps[pdf]", "lib/matplotlib/tests/test_image.py::test_alpha_interp[png]", "lib/matplotlib/tests/test_image.py::test_figimage[png-False]", "lib/matplotlib/tests/test_image.py::test_figimage[png-True]", "lib...
null
true
2021-06-23T03:05:05Z
1
6
1
1,722
0
1
1
0.85
1
0.307
93.646
87
swe_gym::train::1130
swe_gym
train
1,130
pandas-dev__pandas-56368
pandas-dev/pandas
pandas-dev/pandas
python
5e4f2b27db3c7363041b2d969921454b63279e26
BUG: Multiplying strings by int fails with ArrowNotImplementedError: ### Pandas version checks - [X] I have checked that this issue has not already been reported. - [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas. - [ ] I have confirmed this ...
Another NotImlemented error: dec = pd.Series([decimal.Decimal("12.123")], dtype=pd.ArrowDtype(pa.decimal128(5, 3))) dec % 2 ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\ps_0310_is\lib\site-packages\pandas\core\ops\common.py", line 81, in new_method return method(s...
diff --git a/doc/source/whatsnew/v2.2.0.rst b/doc/source/whatsnew/v2.2.0.rst index 67b4052b386c0..c878fd2664dc4 100644 --- a/doc/source/whatsnew/v2.2.0.rst +++ b/doc/source/whatsnew/v2.2.0.rst @@ -576,6 +576,7 @@ Strings ^^^^^^^ - Bug in :func:`pandas.api.types.is_string_dtype` while checking object array with no ele...
diff --git a/pandas/tests/arrays/string_/test_string.py b/pandas/tests/arrays/string_/test_string.py index 524a6632e5544..3e11062b8384e 100644 --- a/pandas/tests/arrays/string_/test_string.py +++ b/pandas/tests/arrays/string_/test_string.py @@ -176,12 +176,7 @@ def test_add_sequence(dtype): tm.assert_extension_arr...
["pandas/tests/arrays/string_/test_string.py::test_mul[pyarrow]", "pandas/tests/arrays/string_/test_string.py::test_mul[pyarrow_numpy]"]
["pandas/tests/extension/test_arrow.py::TestArrowArray::test_setitem_mask[False-int32-numpy-array]", "pandas/tests/extension/test_arrow.py::TestArrowArray::test_value_counts_returns_pyarrow_int64[timestamp[ms,", "pandas/tests/extension/test_arrow.py::TestArrowArray::test_argmin_argmax[uint32]", "pandas/tests/extension/...
null
true
2023-12-06T19:50:49Z
2
27
2
4,918
0
0.85
1
0.92
1
0.59
93.64
88
swe_gym::train::1505
swe_gym
train
1,505
pandas-dev__pandas-48651
pandas-dev/pandas
pandas-dev/pandas
python
5de24481d817339829911e61bd62170a8d0b2734
BUG: regression in read_csv reading from file stream with encoding ### Pandas version checks - [X] I have checked that this issue has not already been reported. - [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas. - [ ] I have confirmed this bu...
I can confirm that it works on 1.4.4 (`engine="c"` and `"python"`) and fails on 1.5.0 for `engine="c"` but works with `engine="python"`. ~~I must admit I slightly prefer the failure with the c-engine in 1.5.0. After `.readline()` the position of the file handle reached the end and should therefore correctly be empt...
diff --git a/doc/source/whatsnew/v1.5.1.rst b/doc/source/whatsnew/v1.5.1.rst index f8069b5476d9e..9d40d9118db32 100644 --- a/doc/source/whatsnew/v1.5.1.rst +++ b/doc/source/whatsnew/v1.5.1.rst @@ -14,7 +14,7 @@ including other versions of pandas. Fixed regressions ~~~~~~~~~~~~~~~~~ -- +- Regression in :func:`.read_...
diff --git a/pandas/tests/io/parser/common/test_common_basic.py b/pandas/tests/io/parser/common/test_common_basic.py index a7cdc3c1a84d2..359b059252556 100644 --- a/pandas/tests/io/parser/common/test_common_basic.py +++ b/pandas/tests/io/parser/common/test_common_basic.py @@ -928,3 +928,17 @@ def test_read_table_posarg...
["pandas/tests/io/parser/common/test_common_basic.py::test_read_seek[c_low]", "pandas/tests/io/parser/common/test_common_basic.py::test_read_seek[c_high]"]
["pandas/tests/io/parser/common/test_common_basic.py::test_read_csv_dataframe[c_high]", "pandas/tests/io/parser/common/test_common_basic.py::test_read_seek[pyarrow]", "pandas/tests/io/parser/common/test_common_basic.py::test_empty_lines[c_high-,-False-exp_data2]", "pandas/tests/io/parser/common/test_common_basic.py::te...
null
true
2022-09-20T01:49:10Z
3
25
2
3,295
0
0.85
1
0.92
1
0.583333
93.62
89
swe_gym::train::1558
swe_gym
train
1,558
pandas-dev__pandas-56332
pandas-dev/pandas
pandas-dev/pandas
python
daa9cdb1c70932afd6d5146c98b48bd95b1c5dd1
BUG: `.str.split()` fails with pyarrow strings ### Pandas version checks - [X] I have checked that this issue has not already been reported. - [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas. - [ ] I have confirmed this bug exists on the [mai...
Just to clarify, you would expect this to split on ``" "`` if nothing is given? For Python strings, calling `.split()` with `sep=None`: > When set to None (the default value), will split on any whitespace > character (including \\n \\r \\t \\f and spaces) and will discard > empty strings from the result. Re...
diff --git a/doc/source/whatsnew/v2.1.4.rst b/doc/source/whatsnew/v2.1.4.rst index 4ef6a2463ee16..927c0ee4f532d 100644 --- a/doc/source/whatsnew/v2.1.4.rst +++ b/doc/source/whatsnew/v2.1.4.rst @@ -24,11 +24,12 @@ Bug fixes - Bug in :class:`Series` constructor raising DeprecationWarning when ``index`` is a list of :cla...
diff --git a/pandas/tests/extension/test_arrow.py b/pandas/tests/extension/test_arrow.py index 7131a50956a7d..b1f989802bf59 100644 --- a/pandas/tests/extension/test_arrow.py +++ b/pandas/tests/extension/test_arrow.py @@ -2076,6 +2076,15 @@ def test_str_partition(): tm.assert_series_equal(result, expected) +@py...
["pandas/tests/extension/test_arrow.py::test_str_split_pat_none[rsplit]", "pandas/tests/extension/test_arrow.py::test_str_split_pat_none[split]"]
["pandas/tests/extension/test_arrow.py::TestArrowArray::test_setitem_mask[False-int32-numpy-array]", "pandas/tests/extension/test_arrow.py::TestArrowArray::test_value_counts_returns_pyarrow_int64[timestamp[ms,", "pandas/tests/extension/test_arrow.py::TestArrowArray::test_argmin_argmax[uint32]", "pandas/tests/extension/...
null
true
2023-12-04T23:26:26Z
2
25
2
5,556
0
0.85
1
0.92
1
0.583333
93.62
90
swe_gym::train::233
swe_gym
train
233
getmoto__moto-5576
getmoto/moto
getmoto/moto
python
3e60cdf3eb4f98e7e09c88c5593e3f589b72d72e
Bug when deleting individual lambda function versions Hello, Deleting lambda function versions, while using Qualifier parameter, is not deleting the right function, but instead, the qualifier value is used as the array index of the version list. ## How to reproduce Given a test lambda function, with 10 versions, from...
Thanks for raising this @tudor-sutu! Looks like our implementation is a bit wonky, indeed. Marking it as a bug.
diff --git a/moto/awslambda/models.py b/moto/awslambda/models.py --- a/moto/awslambda/models.py +++ b/moto/awslambda/models.py @@ -895,6 +895,12 @@ def get_alias(self, name): arn = f"arn:aws:lambda:{self.region}:{self.account_id}:function:{self.function_name}:{name}" raise UnknownAliasException(arn) ...
diff --git a/tests/test_awslambda/test_lambda.py b/tests/test_awslambda/test_lambda.py --- a/tests/test_awslambda/test_lambda.py +++ b/tests/test_awslambda/test_lambda.py @@ -1100,3 +1100,37 @@ def test_remove_unknown_permission_throws_error(): err = exc.value.response["Error"] err["Code"].should.equal("Resou...
["tests/test_awslambda/test_lambda.py::test_multiple_qualifiers", "tests/test_awslambda/test_lambda_alias.py::test_get_function_using_alias"]
["tests/test_awslambda/test_lambda.py::test_publish_version_unknown_function[bad_function_name]", "tests/test_awslambda/test_lambda.py::test_create_function_from_zipfile", "tests/test_awslambda/test_lambda.py::test_create_function_with_already_exists", "tests/test_awslambda/test_lambda_alias.py::test_update_alias_routi...
null
true
2022-10-17 21:33:02
1
25
2
3,913
0
0.85
1
0.92
1
0.583333
93.62
91
swe_gym::train::250
swe_gym
train
250
getmoto__moto-5058
getmoto/moto
getmoto/moto
python
96996b6b4673f5673478758571c296a2a65c9eb0
mock_cloudformation: Wrong ExecutionStatus, Status and StatusReason when creating a change set with no changes. Hello, I've found a minor bug in the mock_cloudformation. **What goes wrong?** When you create a change set with no changes, you get the wrong execution status, status and status reason **How to reproduce:*...
Thanks for raising this @Frogvall! Marking it as an enhancement to validate whether there are any changes, before applying
diff --git a/moto/cloudformation/models.py b/moto/cloudformation/models.py --- a/moto/cloudformation/models.py +++ b/moto/cloudformation/models.py @@ -251,6 +251,17 @@ def __init__( self.creation_time = datetime.utcnow() self.status = "CREATE_PENDING" + def has_template(self, other_template): + ...
diff --git a/tests/test_cloudformation/test_cloudformation_stack_crud_boto3.py b/tests/test_cloudformation/test_cloudformation_stack_crud_boto3.py --- a/tests/test_cloudformation/test_cloudformation_stack_crud_boto3.py +++ b/tests/test_cloudformation/test_cloudformation_stack_crud_boto3.py @@ -1641,6 +1641,83 @@ def te...
["tests/test_cloudformation/test_cloudformation_stack_crud_boto3.py::test_create_change_set_twice__no_changes", "tests/test_cloudformation/test_cloudformation_stack_crud_boto3.py::test_create_change_set_twice__using_s3__no_changes"]
["tests/test_cloudformation/test_cloudformation_stack_crud_boto3.py::test_describe_stack_with_special_chars", "tests/test_cloudformation/test_cloudformation_stack_crud_boto3.py::test_get_template_summary", "tests/test_cloudformation/test_cloudformation_stack_crud_boto3.py::test_create_change_set_from_s3_url", "tests/te...
null
true
2022-04-24 14:28:18
1
25
2
5,334
0
0.85
1
0.92
1
0.583333
93.62
92
swe_gym::train::2395
swe_gym
train
2,395
modin-project__modin-6560
modin-project/modin
modin-project/modin
python
abe20a57b82ae366b2394171d1a7dd50ca1b9cb9
BUG: can't unwrap virtual partitions with axis=None ### Modin version checks - [X] I have checked that this issue has not already been reported. - [X] I have confirmed this bug exists on the latest released version of Modin. - [X] I have confirmed this bug exists on the main branch of Modin. (In order to do this you...
@kukushking thanks for reporting this bug. I can reproduce it locally at commit 87c8f70da9f8021e5eb005b20af839979d9f9bdb. Virtual partitions contain a list of object references to physical blocks in order along some axis, so really modin dataframes with virtual partitions have a 3d array of blocks. I think `unwrap_p...
diff --git a/modin/distributed/dataframe/pandas/partitions.py b/modin/distributed/dataframe/pandas/partitions.py --- a/modin/distributed/dataframe/pandas/partitions.py +++ b/modin/distributed/dataframe/pandas/partitions.py @@ -23,18 +23,30 @@ if TYPE_CHECKING: from modin.core.execution.ray.implementations.pandas_...
diff --git a/modin/test/test_partition_api.py b/modin/test/test_partition_api.py --- a/modin/test/test_partition_api.py +++ b/modin/test/test_partition_api.py @@ -114,6 +114,28 @@ def get_df(lib, data): ) +def test_unwrap_virtual_partitions(): + # see #5164 for details + data = test_data["int...
["modin/test/test_partition_api.py::test_unwrap_virtual_partitions"]
["modin/test/test_partition_api.py::test_from_partitions[None-None-columns-row_lengths-column_widths]", "modin/test/test_partition_api.py::test_unwrap_partitions[True-True-0]", "modin/test/test_partition_api.py::test_from_partitions_mismatched_labels[None-new_idx-new_col]", "modin/test/test_partition_api.py::test_from_...
null
true
2023-09-14T20:40:18Z
1
25
1
3,778
0
0.85
1
0.92
1
0.583333
93.62
93
swe_gym::train::1739
swe_gym
train
1,739
pandas-dev__pandas-49419
pandas-dev/pandas
pandas-dev/pandas
python
a215264d472e79c48433fa3a04fa492abc41e38d
BUG: Unclear error message when merging tables and passing invalid option to validate ### Pandas version checks - [X] I have checked that this issue has not already been reported. - [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas. - [X] I hav...
diff --git a/doc/source/whatsnew/v2.0.0.rst b/doc/source/whatsnew/v2.0.0.rst index ac3a1ca95fbb4..4aa26d406015f 100644 --- a/doc/source/whatsnew/v2.0.0.rst +++ b/doc/source/whatsnew/v2.0.0.rst @@ -464,6 +464,7 @@ Reshaping - Bug in :meth:`DataFrame.pivot` not respecting ``None`` as column name (:issue:`48293`) - Bug ...
diff --git a/pandas/tests/frame/methods/test_join.py b/pandas/tests/frame/methods/test_join.py index 9081f69d5d2bc..9a4837939aceb 100644 --- a/pandas/tests/frame/methods/test_join.py +++ b/pandas/tests/frame/methods/test_join.py @@ -143,7 +143,18 @@ def test_suffix_on_list_join(): def test_join_invalid_validate(left_n...
["pandas/tests/reshape/merge/test_merge.py::TestMerge::test_validation", "pandas/tests/frame/methods/test_join.py::test_join_invalid_validate"]
["pandas/tests/reshape/merge/test_merge.py::TestMerge::test_other_datetime_unit[m]", "pandas/tests/reshape/merge/test_merge.py::test_merge_string_float_column_result", "pandas/tests/reshape/merge/test_merge.py::TestMerge::test_merge_type", "pandas/tests/reshape/merge/test_merge.py::TestMerge::test_merge_empty_frame[boo...
null
true
2022-10-31T18:22:31Z
2
14
2
2,641
0
0.85
1
1
1
0.486833
93.6105
94
swe_gym::train::1821
swe_gym
train
1,821
pandas-dev__pandas-56771
pandas-dev/pandas
pandas-dev/pandas
python
99db9aff1441383e9832ad4ce20e37a1ea3f13c7
BUG: PyArrow-backed DataFrame not exportable to Stata format ### Pandas version checks - [X] I have checked that this issue has not already been reported. - [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas. - [X] I have confirmed this bug exis...
This is an issue for any extension type current as it appears the stata code always assumes numpy types I'm having a similar issue with string columns converted from object to StringDType. The code below raises: NotImplementedError: Data type string not supported. I'm guessing StringDType is also an extension type? Any...
diff --git a/doc/source/whatsnew/v2.2.0.rst b/doc/source/whatsnew/v2.2.0.rst index 0b04a1d313a6d..b90185ab9b4ea 100644 --- a/doc/source/whatsnew/v2.2.0.rst +++ b/doc/source/whatsnew/v2.2.0.rst @@ -846,6 +846,7 @@ I/O - Bug in :func:`read_json` not handling dtype conversion properly if ``infer_string`` is set (:issue:`...
diff --git a/pandas/tests/io/test_stata.py b/pandas/tests/io/test_stata.py index 799b0a63feb53..11b53d711fce2 100644 --- a/pandas/tests/io/test_stata.py +++ b/pandas/tests/io/test_stata.py @@ -11,6 +11,8 @@ import numpy as np import pytest +import pandas.util._test_decorators as td + import pandas as pd from pand...
["pandas/tests/io/test_stata.py::TestStata::test_read_write_ea_dtypes[numpy_nullable]", "pandas/tests/io/test_stata.py::TestStata::test_read_write_ea_dtypes[pyarrow]"]
["pandas/tests/io/test_stata.py::TestStata::test_invalid_date_conversion", "pandas/tests/io/test_stata.py::TestStata::test_gzip_writing", "pandas/tests/io/test_stata.py::TestStata::test_read_dta12", "pandas/tests/io/test_stata.py::TestStata::test_write_preserves_original", "pandas/tests/io/test_stata.py::test_nullable_...
null
true
2024-01-07T21:01:31Z
2
24
2
3,752
0
0.85
1
0.92
1
0.58
93.61
95
swe_gym::train::1377
swe_gym
train
1,377
pandas-dev__pandas-58360
pandas-dev/pandas
pandas-dev/pandas
python
bfe5be01fef4eaecf4ab033e74139b0a3cac4a39
BUG: Can't compute cummin/cummax on ordered categorical ### Pandas version checks - [X] I have checked that this issue has not already been reported. - [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas. - [X] I have confirmed this bug exists on...
Thanks for the report. The error raise is `NotImplementedError`, so I think this is an enhancement rather than a bug. +1 on supporting. take
diff --git a/doc/source/whatsnew/v3.0.0.rst b/doc/source/whatsnew/v3.0.0.rst index 7823f74b7a153..ff3fd65b9bcea 100644 --- a/doc/source/whatsnew/v3.0.0.rst +++ b/doc/source/whatsnew/v3.0.0.rst @@ -41,6 +41,7 @@ Other enhancements - :class:`.errors.DtypeWarning` improved to include column names when mixed data types ar...
diff --git a/pandas/tests/series/test_cumulative.py b/pandas/tests/series/test_cumulative.py index 9b7b08127a550..a9d5486139b46 100644 --- a/pandas/tests/series/test_cumulative.py +++ b/pandas/tests/series/test_cumulative.py @@ -170,6 +170,58 @@ def test_cummethods_bool_in_object_dtype(self, method, expected): ...
["pandas/tests/series/test_cumulative.py::TestSeriesCumulativeOps::test_cummax_cummin_ordered_categorical_nan[cummax-abc-False-exp1]", "pandas/tests/series/test_cumulative.py::TestSeriesCumulativeOps::test_cummax_cummin_ordered_categorical_nan[cummin-cba-True-exp0]", "pandas/tests/series/test_cumulative.py::TestSeriesC...
["pandas/tests/series/test_cumulative.py::TestSeriesCumulativeOps::test_cummin_cummax_datetimelike[cummax-False-exp_tdi2-ts0]", "pandas/tests/series/test_cumulative.py::TestSeriesCumulativeOps::test_cummin_cummax[cummin]", "pandas/tests/series/test_cumulative.py::TestSeriesCumulativeOps::test_cummethods_bool[cumprod-in...
null
true
2024-04-21T20:15:45Z
2
24
6
5,526
0
0.85
1
0.92
1
0.58
93.61
96
swe_bench_verified::test::286
swe_bench_verified
test
286
matplotlib__matplotlib-26466
matplotlib/matplotlib
matplotlib/matplotlib
python
3dd06a46750d174f821df5377996f493f1af4ebb
Updating an array passed as the xy parameter to annotate updates the anottation ### Bug report **Bug summary** When an array is used as the _xy_ kwarg for an annotation that includes arrows, changing the array after calling the function changes the arrow position. It is very likely that the same array is kept instead ...
I guess that a simple patch to _AnnotationBase init should work, but I'd check for more places where the a similar bug can be hidden: Maybe changing: https://github.com/matplotlib/matplotlib/blob/89fa0e43b63512c595387a37bdfd37196ced69be/lib/matplotlib/text.py#L1332 for `self.xy=np.array(xy)` is enough. This code...
diff --git a/lib/matplotlib/text.py b/lib/matplotlib/text.py --- a/lib/matplotlib/text.py +++ b/lib/matplotlib/text.py @@ -1389,7 +1389,8 @@ def __init__(self, artist, ref_coord, unit="points"): The screen units to use (pixels or points) for the offset input. """ self._artist = artist - ...
diff --git a/lib/matplotlib/tests/test_text.py b/lib/matplotlib/tests/test_text.py --- a/lib/matplotlib/tests/test_text.py +++ b/lib/matplotlib/tests/test_text.py @@ -16,7 +16,7 @@ import matplotlib.transforms as mtransforms from matplotlib.testing.decorators import check_figures_equal, image_comparison from matplot...
["lib/matplotlib/tests/test_text.py::test_annotate_and_offsetfrom_copy_input[png]"]
["lib/matplotlib/tests/test_text.py::test_font_styles[png]", "lib/matplotlib/tests/test_text.py::test_font_styles[pdf]", "lib/matplotlib/tests/test_text.py::test_multiline[png]", "lib/matplotlib/tests/test_text.py::test_multiline[pdf]", "lib/matplotlib/tests/test_text.py::test_multiline2[png]", "lib/matplotlib/tests/te...
null
true
2023-08-07T19:30:22Z
1
20
1
1,365
0
1
1
0.85
1
0.294167
93.6075
97
swe_bench_verified::test::380
swe_bench_verified
test
380
scikit-learn__scikit-learn-9288
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
3eacf948e0f95ef957862568d87ce082f378e186
KMeans gives slightly different result for n_jobs=1 vs. n_jobs > 1 #### Description I noticed that `cluster.KMeans` gives a slightly different result depending on if `n_jobs=1` or `n_jobs>1`. #### Steps/Code to Reproduce Below is the code I used to run the same `KMeans` clustering on a varying number of jobs. ```p...
Looks like the `n_jobs=1` case gets a different random seed for the `n_init` runs than the `n_jobs!=1` case. https://github.com/scikit-learn/scikit-learn/blob/7a2ce27a8f5a24db62998d444ed97470ad24319b/sklearn/cluster/k_means_.py#L338-L363 I'll submit a PR that sets `random_state` to be the same in both cases. I'v...
diff --git a/sklearn/cluster/k_means_.py b/sklearn/cluster/k_means_.py --- a/sklearn/cluster/k_means_.py +++ b/sklearn/cluster/k_means_.py @@ -360,16 +360,18 @@ def k_means(X, n_clusters, sample_weight=None, init='k-means++', else: raise ValueError("Algorithm must be 'auto', 'full' or 'elkan', got" ...
diff --git a/sklearn/cluster/tests/test_k_means.py b/sklearn/cluster/tests/test_k_means.py --- a/sklearn/cluster/tests/test_k_means.py +++ b/sklearn/cluster/tests/test_k_means.py @@ -951,3 +951,13 @@ def test_minibatch_kmeans_partial_fit_int_data(): km = MiniBatchKMeans(n_clusters=2) km.partial_fit(X) as...
["sklearn/cluster/tests/test_k_means.py::test_result_of_kmeans_equal_in_diff_n_jobs"]
["sklearn/cluster/tests/test_k_means.py::test_kmeans_results[float32-dense-full]", "sklearn/cluster/tests/test_k_means.py::test_kmeans_results[float32-dense-elkan]", "sklearn/cluster/tests/test_k_means.py::test_kmeans_results[float32-sparse-full]", "sklearn/cluster/tests/test_k_means.py::test_kmeans_results[float64-den...
null
true
2017-07-06T11:03:14Z
1
7
1
1,600
0
1
1
0.85
1
0.29
93.595
98
swe_gym::train::1578
swe_gym
train
1,578
pandas-dev__pandas-53360
pandas-dev/pandas
pandas-dev/pandas
python
71cfd3a2d56ff81404e13b7e5c6a9720d52a3a81
BUG: `read_csv` with `index_col` option on pyarrow dtype cause error. ### Pandas version checks - [X] I have checked that this issue has not already been reported. - [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas. - [X] I have confirmed this...
Hi, thanks for the report. I can reproduce this on main. I turned your example into a copy-pastable one. I get an error even if using pandas types however. ``` from io import StringIO test=""" col1,col2 a,1 b,2 """ f=StringIO(test) import pandas as pd import pyarrow as pa df = pd.read_csv( f, dtype=...
diff --git a/doc/source/whatsnew/v2.1.0.rst b/doc/source/whatsnew/v2.1.0.rst index db97602dcf4df..e19da05583e80 100644 --- a/doc/source/whatsnew/v2.1.0.rst +++ b/doc/source/whatsnew/v2.1.0.rst @@ -392,6 +392,7 @@ I/O - :meth:`DataFrame.to_sql` now raising ``ValueError`` when the name param is left empty while using SQ...
diff --git a/pandas/tests/io/parser/test_index_col.py b/pandas/tests/io/parser/test_index_col.py index 13c4216710f84..cd12ecc4fc7cc 100644 --- a/pandas/tests/io/parser/test_index_col.py +++ b/pandas/tests/io/parser/test_index_col.py @@ -324,12 +324,15 @@ def test_infer_types_boolean_sum(all_parsers): tm.assert_fra...
["pandas/tests/io/parser/test_index_col.py::test_specify_dtype_for_index_col[pyarrow-int64-1]", "pandas/tests/io/parser/usecols/test_usecols_basic.py::test_usecols_dtype[pyarrow]"]
["pandas/tests/io/parser/usecols/test_usecols_basic.py::test_usecols_indices_out_of_bounds[c_low-None]", "pandas/tests/io/parser/usecols/test_usecols_basic.py::test_usecols_additional_columns[python]", "pandas/tests/io/parser/usecols/test_usecols_basic.py::test_raises_on_usecols_names_mismatch[c_low-usecols0-kwargs0-ex...
null
true
2023-05-23T21:27:28Z
2
20
2
3,513
0
0.85
1
0.92
1
0.566667
93.57
99
swe_bench_verified::test::372
swe_bench_verified
test
372
scikit-learn__scikit-learn-15100
scikit-learn/scikit-learn
scikit-learn/scikit-learn
python
af8a6e592a1a15d92d77011856d5aa0ec4db4c6c
strip_accents_unicode fails to strip accents from strings that are already in NFKD form #### Description The `strip_accents="unicode"` feature of `CountVectorizer` and related does not work as expected when it processes strings that contain accents, if those strings are already in NFKD form. #### Steps/Code to Repro...
Good catch. Are you able to provide a fix? It looks like we should just remove the `if` branch from `strip_accents_unicode`: ```python def strip_accents_unicode(s): normalized = unicodedata.normalize('NFKD', s) return ''.join([c for c in normalized if not unicodedata.combining(c)]) ``` If that sounds ...
diff --git a/sklearn/feature_extraction/text.py b/sklearn/feature_extraction/text.py --- a/sklearn/feature_extraction/text.py +++ b/sklearn/feature_extraction/text.py @@ -129,10 +129,13 @@ def strip_accents_unicode(s): Remove accentuated char for any unicode symbol that has a direct ASCII equivalent. ...
diff --git a/sklearn/feature_extraction/tests/test_text.py b/sklearn/feature_extraction/tests/test_text.py --- a/sklearn/feature_extraction/tests/test_text.py +++ b/sklearn/feature_extraction/tests/test_text.py @@ -97,6 +97,21 @@ def test_strip_accents(): expected = 'this is a test' assert strip_accents_unico...
["sklearn/feature_extraction/tests/test_text.py::test_strip_accents"]
["sklearn/feature_extraction/tests/test_text.py::test_to_ascii", "sklearn/feature_extraction/tests/test_text.py::test_word_analyzer_unigrams[CountVectorizer]", "sklearn/feature_extraction/tests/test_text.py::test_word_analyzer_unigrams[HashingVectorizer]", "sklearn/feature_extraction/tests/test_text.py::test_word_analy...
null
true
2019-09-26T19:21:38Z
1
9
1
1,502
0
1
1
0.85
1
0.280333
93.566