instance_id stringlengths 21 53 | repo stringclasses 188
values | language stringclasses 1
value | pull_number int64 20 148k | title stringlengths 6 144 | body stringlengths 0 83.4k | created_at stringdate 2015-09-25 03:17:17 2025-07-10 16:50:35 | problem_statement stringlengths 188 240k | hints_text stringlengths 0 145k | resolved_issues listlengths 1 6 | base_commit stringlengths 40 40 | commit_to_review dict | reference_review_comments listlengths 1 62 | merged_commit stringlengths 40 40 | merged_patch stringlengths 297 9.87M | metadata dict |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
scikit-learn__scikit-learn-25570@1b936b1 | scikit-learn/scikit-learn | Python | 25,570 | FIX Fixes ColumnTransformer to support empty selection for pandas output | <!--
Thanks for contributing a pull request! Please ensure you have taken a look at
the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md
-->
#### Reference Issues/PRs
<!--
Example: Fixes #1234. See also #3456.
Please use keywords (e.g., Fixes) to create link to th... | 2023-02-08T18:28:21Z | ColumnTransformer with pandas output can't handle transformers with no features
### Describe the bug
Hi,
ColumnTransformer doesn't deal well with transformers that apply to 0 features (categorical_features in the example below) when using "pandas" as output. It seems steps with 0 features are not fitted, hence do... | [
{
"body": "### Describe the bug\r\n\r\nHi,\r\n\r\nColumnTransformer doesn't deal well with transformers that apply to 0 features (categorical_features in the example below) when using \"pandas\" as output. It seems steps with 0 features are not fitted, hence don't appear in `self._iter(fitted=True)` (_column_tr... | cd25abee0ad0ac95225d4a9be8948eff69f49690 | {
"head_commit": "1b936b1f57a5fa4fd3cb3d84f5c784bcccc5eeab",
"head_commit_message": "DOC adds whats new number",
"patch_to_review": "diff --git a/doc/whats_new/v1.2.rst b/doc/whats_new/v1.2.rst\nindex fdb48fce032f5..0e62b87a2ab48 100644\n--- a/doc/whats_new/v1.2.rst\n+++ b/doc/whats_new/v1.2.rst\n@@ -34,6 +34,13 ... | [
{
"diff_hunk": "@@ -865,7 +865,7 @@ def _hstack(self, Xs):\n transformer_names = [\n t[0] for t in self._iter(fitted=True, replace_strings=True)\n ]\n- feature_names_outs = [X.columns for X in Xs]\n+ feature_names_outs = [X.column... | 18bd3eb9fe8e59eff4b45f72defcdef49e712295 | diff --git a/doc/whats_new/v1.2.rst b/doc/whats_new/v1.2.rst
index fdb48fce032f5..0e62b87a2ab48 100644
--- a/doc/whats_new/v1.2.rst
+++ b/doc/whats_new/v1.2.rst
@@ -34,6 +34,13 @@ Changelog
fail due to a permutation of the labels when running multiple inits.
:pr:`25563` by :user:`Jérémie du Boisberranger <jeremie... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} | |
scikit-learn__scikit-learn-25500@212b119 | scikit-learn/scikit-learn | Python | 25,500 | FIX make IsotonicRegression predict NumPy array | closes #25499
Make sure that `IsotonicRegression` outputs NumPy array when calling `predict`.
Since `predict` was calling `transform` then the wrapper setting the type of output was also called.
Here, we make a private `_transform` method, called by both `predict` and `transform`. We, therefore, avoid calling t... | 2023-01-27T19:49:28Z | CalibratedClassifierCV doesn't work with `set_config(transform_output="pandas")`
### Describe the bug
CalibratedClassifierCV with isotonic regression doesn't work when we previously set `set_config(transform_output="pandas")`.
The IsotonicRegression seems to return a dataframe, which is a problem for `_CalibratedCl... | I can reproduce it. We need to investigate but I would expect the inner estimator not being able to handle some dataframe because we expected NumPy arrays before.
This could be a bit like https://github.com/scikit-learn/scikit-learn/pull/25370 where things get confused when pandas output is configured. I think the solu... | [
{
"body": "### Describe the bug\r\n\r\nCalibratedClassifierCV with isotonic regression doesn't work when we previously set `set_config(transform_output=\"pandas\")`.\r\nThe IsotonicRegression seems to return a dataframe, which is a problem for `_CalibratedClassifier` in `predict_proba` where it tries to put th... | 4db04923a754b6a2defa1b172f55d492b85d165e | {
"head_commit": "212b119a71192ef5be96592d9e504d40425e1d64",
"head_commit_message": "DOC update pr number",
"patch_to_review": "diff --git a/doc/whats_new/v1.2.rst b/doc/whats_new/v1.2.rst\nindex 3dd5edfceea86..04014f8ee5697 100644\n--- a/doc/whats_new/v1.2.rst\n+++ b/doc/whats_new/v1.2.rst\n@@ -2,6 +2,39 @@\n \n... | [
{
"diff_hunk": "@@ -2,6 +2,39 @@\n \n .. currentmodule:: sklearn\n \n+.. _changes_1_2_2:\n+\n+Version 1.2.2\n+=============\n+\n+**In development**\n+\n+The following estimators and functions, when fit with the same data and\n+parameters, may produce different models from the previous version. This often\n+occu... | ddbe61b1cd3b65cd9cd25586fe138b3b06b23366 | diff --git a/doc/whats_new/v1.2.rst b/doc/whats_new/v1.2.rst
index 3dd5edfceea86..c572acf49370c 100644
--- a/doc/whats_new/v1.2.rst
+++ b/doc/whats_new/v1.2.rst
@@ -2,6 +2,39 @@
.. currentmodule:: sklearn
+.. _changes_1_2_2:
+
+Version 1.2.2
+=============
+
+**In development**
+
+The following estimators and func... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
scikit-learn__scikit-learn-25638@ce2d110 | scikit-learn/scikit-learn | Python | 25,638 | ENH Allows target to be pandas nullable dtypes | <!--
Thanks for contributing a pull request! Please ensure you have taken a look at
the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md
-->
#### Reference Issues/PRs
<!--
Example: Fixes #1234. See also #3456.
Please use keywords (e.g., Fixes) to create link to th... | 2023-02-17T22:17:50Z | Support nullable pandas dtypes in `unique_labels`
### Describe the workflow you want to enable
I would like to be able to pass the nullable pandas dtypes ("Int64", "Float64", "boolean") into sklearn's `unique_labels` function. Because the dtypes become `object` dtype when converted to numpy arrays we get `ValueError: ... | Thank you for opening the issue! The underlying issue comes from how pandas exposes `__array__` to be object dtypes with nullable dtypes:
```python
import pandas as pd
y_true = pd.Series([1, 0, 0, 1, 0, 1, 1, 0, 1], dtype="Int64")
print(np.asarray(y_true).dtype)
# object
y_pred = pd.Series([1, 0, 0, 1, 0, 1... | [
{
"body": "### Describe the workflow you want to enable\n\nI would like to be able to pass the nullable pandas dtypes (\"Int64\", \"Float64\", \"boolean\") into sklearn's `unique_labels` function. Because the dtypes become `object` dtype when converted to numpy arrays we get `ValueError: Mix type of y not allow... | 6adb209acd63825affc884abcd85381f148fb1b0 | {
"head_commit": "ce2d11078aa3c4ff1dfb624363cb1a21ae3df784",
"head_commit_message": "DOC Adds PR number",
"patch_to_review": "diff --git a/doc/whats_new/v1.3.rst b/doc/whats_new/v1.3.rst\nindex 08ebf4abc92c3..2af49651b8a8b 100644\n--- a/doc/whats_new/v1.3.rst\n+++ b/doc/whats_new/v1.3.rst\n@@ -222,6 +222,9 @@ Cha... | [
{
"diff_hunk": "@@ -340,8 +363,10 @@ def type_of_target(y, input_name=\"\"):\n return \"binary\" # []\n # 2-D empty array: [[]]\n return \"unknown\"\n- if not issparse(y) and y.dtype == object and not isinstance(y.flat[0], str):\n- # [obj_1] and not [\"label_1\"]\n+\n+ ... | d5539fedceb2ec2e016b1c8eafd7b56fbba61019 | diff --git a/doc/whats_new/v1.3.rst b/doc/whats_new/v1.3.rst
index e7cd4c1a0e19d..ce579874f886c 100644
--- a/doc/whats_new/v1.3.rst
+++ b/doc/whats_new/v1.3.rst
@@ -244,6 +244,9 @@ Changelog
during `transform` with no prior call to `fit` or `fit_transform`.
:pr:`25190` by :user:`Vincent Maladière <Vincent-Maladie... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} |
scikit-learn__scikit-learn-25587@156c5d0 | scikit-learn/scikit-learn | Python | 25,587 | ENH Support float32 in SGDClassifier and SGDRegressor | <!--
Thanks for contributing a pull request! Please ensure you have taken a look at
the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md
-->
#### Reference Issues/PRs
<!--
Example: Fixes #1234. See also #3456.
Please use keywords (e.g., Fixes) to create link to th... | 2023-02-10T14:00:06Z | Add float32 support for SGDClassifier and SGDRegressor
Hi,
I was wondreing why `sklearn` does not allow me to specify the `dtype` I'd like to use.
I'm working with rather large dataset, which fits into my RAM as float32, but when I'm trying to train a simple SGD on it, the model tries to copy my data into float64, c... | PR welcome ;)
It would be great to have both 32 and 64 bit everywhere, I think.
This means using fused types everywhere in Cython.
One of the reasons not to do that was the explosion in the generated C code, but I think with #5492 we need to be somewhat less careful about that.
#13243 implemented float32 support for ... | [
{
"body": "Hi, \n\nI was wondreing why `sklearn` does not allow me to specify the `dtype` I'd like to use.\n\nI'm working with rather large dataset, which fits into my RAM as float32, but when I'm trying to train a simple SGD on it, the model tries to copy my data into float64, causing MemoryError. \n\nI can ch... | e6b46675318950fd5138aaf29ba76f6ce2fd91b8 | {
"head_commit": "156c5d0de7b8c1c7c5ccedee7edcc93680a2d96a",
"head_commit_message": "Add preserves_dtype in _more_tags",
"patch_to_review": "diff --git a/.gitignore b/.gitignore\nindex 47ec8fa2faf79..f6250b4d5f580 100644\n--- a/.gitignore\n+++ b/.gitignore\n@@ -85,6 +85,7 @@ sklearn/utils/_seq_dataset.pxd\n sklea... | [
{
"diff_hunk": "@@ -359,37 +396,145 @@ cdef class SquaredEpsilonInsensitive(Regression):\n def __reduce__(self):\n return SquaredEpsilonInsensitive, (self.epsilon,)\n \n-\n-def _plain_sgd(const double[::1] weights,\n- double intercept,\n- const double[::1] average_weights... | cb3875ed77db4bd88568c51aa639ea4c0b98a887 | diff --git a/.gitignore b/.gitignore
index 47ec8fa2faf79..f6250b4d5f580 100644
--- a/.gitignore
+++ b/.gitignore
@@ -85,6 +85,7 @@ sklearn/utils/_seq_dataset.pxd
sklearn/utils/_weight_vector.pyx
sklearn/utils/_weight_vector.pxd
sklearn/linear_model/_sag_fast.pyx
+sklearn/linear_model/_sgd_fast.pyx
sklearn/metrics/_... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "New Feature Additions"
} |
scikit-learn__scikit-learn-25752@0d7a725 | scikit-learn/scikit-learn | Python | 25,752 | ENH KMeans initialization account for sample weights | Fixes #25527 | 2023-03-03T09:07:31Z | KMeans initialization does not use sample weights
### Describe the bug
Clustering by KMeans does not weight the input data.
### Steps/Code to Reproduce
```py
import numpy as np
from sklearn.cluster import KMeans
x = np.array([1, 1, 5, 5, 100, 100])
w = 10**np.array([8.,8,8,8,-8,-8]) # large weights for 1 a... | Thanks for the reproducible example.
`KMeans` **does** weight the data, but your example is an extreme case. Because `Kmeans` is a non-convex problem, the algorithm can get stuck in a local minimum, and not find the true minimum of the optimization landscape. This is the reason why the code proposes to use multiple... | [
{
"body": "### Describe the bug\r\n\r\nClustering by KMeans does not weight the input data.\r\n\r\n### Steps/Code to Reproduce\r\n\r\n```py\r\nimport numpy as np\r\nfrom sklearn.cluster import KMeans\r\nx = np.array([1, 1, 5, 5, 100, 100])\r\nw = 10**np.array([8.,8,8,8,-8,-8]) # large weights for 1 and 5, small... | b397b8f2d952a26344cc062ff912c663f4afa6d5 | {
"head_commit": "0d7a7253c1084418f9680c9fdef41e8ebd46a88b",
"head_commit_message": "Update _kmeans.py",
"patch_to_review": "diff --git a/doc/whats_new/v1.3.rst b/doc/whats_new/v1.3.rst\nindex 7f4450975cd60..c902a0da15c54 100644\n--- a/doc/whats_new/v1.3.rst\n+++ b/doc/whats_new/v1.3.rst\n@@ -107,9 +107,18 @@ Cha... | [
{
"diff_hunk": "@@ -206,7 +208,7 @@ def _kmeans_plusplus(X, n_clusters, x_squared_norms, random_state, n_local_trial\n n_local_trials = 2 + int(np.log(n_clusters))\n \n # Pick first center randomly and track index of point\n- center_id = random_state.randint(n_samples)\n+ center_id = random_st... | 537a83a0f90a8a5800afcd498519b34b79665de2 | diff --git a/doc/whats_new/v1.3.rst b/doc/whats_new/v1.3.rst
index 439b348ce2610..caba58cc82538 100644
--- a/doc/whats_new/v1.3.rst
+++ b/doc/whats_new/v1.3.rst
@@ -34,6 +34,15 @@ random sampling procedures.
:class:`decomposition.MiniBatchNMF` which can produce different results than previous
versions. :pr:`25438... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Bug Fixes"
} |
scikit-learn__scikit-learn-25363@1fd6a88 | scikit-learn/scikit-learn | Python | 25,363 | FIX propagate configuration to workers in parallel | closes #25242
closes #25239
closes #25290
This is an alternative to #25290. The issue in #25290 is that we change the public API for 1.2.1. Making the change in a private `_delayed` is not really possible since we would warn our user or developer to use a private function.
This PR proposes to overload `Parallel... | 2023-01-11T16:39:30Z | ColumnTransformers don't honor set_config(transform_output="pandas") when multiprocessing with n_jobs>1
### Describe the bug
I'm trying to do a grid search with `n_jobs=-1`, working with pandas output, and it fails despite `set_config(transform_output = "pandas")`
I have to manually `.set_output(transform='pandas... | I suspect that this is related to https://github.com/scikit-learn/scikit-learn/pull/17634 and https://github.com/joblib/joblib/issues/1071. I thought that we fixed the issue.
So there is something weird. The setting got changed in the middle of the processing. I did try 3 `Cs` and `cv=10` and printed the config state a... | [
{
"body": "### Describe the bug\r\n\r\nI'm trying to do a grid search with `n_jobs=-1`, working with pandas output, and it fails despite `set_config(transform_output = \"pandas\")`\r\n\r\nI have to manually `.set_output(transform='pandas')` in the ColumnTransformer for it to work.\r\n\r\n### Steps/Code to Repro... | cfd428afc5b6e25bbbe4bc92067f857fa9658442 | {
"head_commit": "1fd6a88379892671be7d5479407c17c74163ce88",
"head_commit_message": "DOC add deprecation in changelog",
"patch_to_review": "diff --git a/build_tools/azure/linting.sh b/build_tools/azure/linting.sh\nindex 21ef53c8012dc..9c59a72cd7848 100755\n--- a/build_tools/azure/linting.sh\n+++ b/build_tools/azu... | [
{
"diff_hunk": "@@ -34,10 +34,10 @@ then\n exit 1\n fi\n \n-joblib_import=\"$(git grep -l -A 10 -E \"joblib import.+delayed\" -- \"*.py\" \":!sklearn/utils/_joblib.py\" \":!sklearn/utils/fixes.py\")\"\n+joblib_import=\"$(git grep -l -A 10 -E \"joblib import.+delayed\" -- \"*.py\" \":!sklearn/utils/_joblib.p... | 15526e8918ae9756589e23332a8491d5bf068925 | diff --git a/benchmarks/bench_saga.py b/benchmarks/bench_saga.py
index 581f7e3881e9e..340549ef240e1 100644
--- a/benchmarks/bench_saga.py
+++ b/benchmarks/bench_saga.py
@@ -7,8 +7,7 @@
import time
import os
-from joblib import Parallel
-from sklearn.utils.fixes import delayed
+from sklearn.utils.parallel import del... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Bug Fixes"
} |
scikit-learn__scikit-learn-25443@d8bcaf9 | scikit-learn/scikit-learn | Python | 25,443 | FIX report properly `n_iter_` when `warm_start=True` | closes #24764
closes #8713
related to https://github.com/scikit-learn/scikit-learn/issues/25522
In `MLPEstimator`, `n_iter_` does not report the number of iterations of the `fit` call but rather the total number of iterations since the initialization. This is inconsistent with the other estimators as reported in #... | 2023-01-20T14:46:21Z | With MLPClassifer, when warm_start is True or coeffs_ are provided, fit doesn’t respect max_iters
#### Description
With MLPClassifer, when warm_start is True or coeffs_ are provided, fit doesn’t respect max_iters. The reason for this is, when fitting, max iteration check is equality (==) against self.n_iter_. When war... | I would like to investigate this.
Just change the **random_state** parameter to **0** i.e. **random_state=_0_**. This will give you the same result
@Julisam sorry I don't follow.
I think ``max_iter`` should probably be the total number of calls for consistency with ``RandomForest`` (and gradient boosting?). That means ... | [
{
"body": "#### Description\r\nWith MLPClassifer, when warm_start is True or coeffs_ are provided, fit doesn’t respect max_iters. The reason for this is, when fitting, max iteration check is equality (==) against self.n_iter_. When warm_start is true or coeffs_ are provided, initialize is not called; this metho... | 677a4cfef679313cd437c6af9e0398a22df73ab6 | {
"head_commit": "d8bcaf9ac5f493a85ebb94d58c1cd01f336819a4",
"head_commit_message": "Bug: Change return to break (out of loop)",
"patch_to_review": "diff --git a/sklearn/neural_network/_multilayer_perceptron.py b/sklearn/neural_network/_multilayer_perceptron.py\nindex 7ed0ab33a0f29..f950e6d5c649c 100644\n--- a/sk... | [
{
"diff_hunk": "@@ -687,6 +687,7 @@ def _fit_stochastic(\n % self.max_iter,\n ConvergenceWarning,\n )\n+ break",
"line": null,
"original_line": 690,
"original_start_line": null,
"path": "sklearn/neural_network... | 17a83890aa978e37ac74ced7c8acd13fa0aec529 | diff --git a/doc/whats_new/v1.3.rst b/doc/whats_new/v1.3.rst
index 2b209ee91c027..3e5e5083dd708 100644
--- a/doc/whats_new/v1.3.rst
+++ b/doc/whats_new/v1.3.rst
@@ -179,6 +179,15 @@ Changelog
dissimilarity is not a metric and cannot be supported by the BallTree.
:pr:`25417` by :user:`Guillaume Lemaitre <glemaitre... | {
"difficulty": "medium",
"estimated_review_effort": 2,
"problem_domain": "Bug Fixes"
} |
scikit-learn__scikit-learn-25274@cd3fc0f | scikit-learn/scikit-learn | Python | 25,274 | FIX Handles all numerical DataFrames with check_inverse=True in FunctionTransformer | <!--
Thanks for contributing a pull request! Please ensure you have taken a look at
the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md
-->
#### Reference Issues/PRs
<!--
Example: Fixes #1234. See also #3456.
Please use keywords (e.g., Fixes) to create link to th... | 2023-01-02T16:47:59Z | FunctionTransformer does not handle object dtype when check_inverse is True
#### Describe the bug
FunctionTransformer can process a feature made out of strings in a DataFrame. However, one has to disable the inverse_transform checking otherwise np.allclose is called on the dataframes, causing a crash.
I believe t... | Yep, the round-trip check was only designed for numerical. We should add support for object data type: it should be more expensive but we could check the data type of `X` and then choose the type of check to apply.
take
Also related with https://github.com/scikit-learn/scikit-learn/issues/19905
We introduced the probl... | [
{
"body": "#### Describe the bug\r\n\r\nFunctionTransformer can process a feature made out of strings in a DataFrame. However, one has to disable the inverse_transform checking otherwise np.allclose is called on the dataframes, causing a crash.\r\n\r\nI believe that the behavior should be consistent: either str... | 1c6e182f92b6d29191ef002db94cecc62ad0e856 | {
"head_commit": "cd3fc0f355ae806a672caa72147f9fe7b44357fd",
"head_commit_message": "DOC Adds whats new number",
"patch_to_review": "diff --git a/doc/whats_new/v1.2.rst b/doc/whats_new/v1.2.rst\nindex c99ad4c06ea2f..a8087472a6e10 100644\n--- a/doc/whats_new/v1.2.rst\n+++ b/doc/whats_new/v1.2.rst\n@@ -27,6 +27,13 ... | [
{
"diff_hunk": "@@ -217,6 +217,36 @@ def inverse_func(X):\n transformer.fit(data)\n \n \n+def test_function_transformer_support_all_nummerical_dataframes_check_inverse_True():\n+ \"\"\"Check support for dataframes with only numerical values.\"\"\"\n+ pd = pytest.importorskip(\"pandas\")\n+\n+ d... | 19e7dc706a208f4b4caf34f81bb4a0b046023f69 | diff --git a/doc/whats_new/v1.2.rst b/doc/whats_new/v1.2.rst
index c99ad4c06ea2f..f51d9330246c9 100644
--- a/doc/whats_new/v1.2.rst
+++ b/doc/whats_new/v1.2.rst
@@ -27,6 +27,13 @@ Changelog
`verbose` parameter set to a value greater than 0.
:pr:`25250` by :user:`Jérémie Du Boisberranger <jeremiedbb>`.
+:mod:`sk... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
sqlfluff__sqlfluff-4028@132a79f | sqlfluff/sqlfluff | Python | 4,028 | Rule: check number of columns in set operations match | <!--Thanks for adding this feature!-->
<!--Please give the Pull Request a meaningful title for the release notes-->
### Brief summary of the change made
<!--Please include `fixes #XXXX` to automatically close any corresponding issue when the pull request is merged. Alternatively if not fully closed you can say `... | 2022-11-04T03:20:25Z | Add rule to check number of columns in set operations
Add rule to check that both queries in a set operation contain the same number of columns.
For example:
```
SELECT a, b, c
FROM test_table
UNION ALL
SELECT a, b
FROM test_table_2
```
The above produces a compilation error in Snowflake (`"invalid n... | I like the idea. I suggest that it should raise a linting error, not a parsing error. For technical reasons, rules don't raise parse errors. Parse errors are generally raised only by the parser, when the SQL does not obey the grammar (i.e. the dialect).
Good idea!
A clarification would be if one of the statements cont... | [
{
"body": "Add rule to check that both queries in a set operation contain the same number of columns.\r\n\r\nFor example:\r\n\r\n```\r\nSELECT a, b, c\r\nFROM test_table\r\n\r\nUNION ALL\r\n\r\nSELECT a, b\r\nFROM test_table_2\r\n```\r\n\r\nThe above produces a compilation error in Snowflake (`\"invalid number ... | f5d726a897b25729f2159a6b99486d977abb836c | {
"head_commit": "132a79f89739c5c4dff6955074205a303fc482f2",
"head_commit_message": "edit previous commit message",
"patch_to_review": "diff --git a/src/sqlfluff/rules/L070.py b/src/sqlfluff/rules/L070.py\nnew file mode 100644\nindex 00000000000..34c300536e3\n--- /dev/null\n+++ b/src/sqlfluff/rules/L070.py\n@@ -0... | [
{
"diff_hunk": "@@ -0,0 +1,249 @@\n+\"\"\"Implementation of Rule L070.\"\"\"\n+from typing import Optional\n+\n+from sqlfluff.utils.analysis.select_crawler import Query, SelectCrawler, WildcardInfo\n+from sqlfluff.core.rules import BaseRule, LintResult, RuleContext\n+from sqlfluff.core.rules.crawlers import Seg... | 8f54c2c6814a8f7d877ce52cceb158ce88708d19 | diff --git a/src/sqlfluff/rules/L070.py b/src/sqlfluff/rules/L070.py
new file mode 100644
index 00000000000..212b1f2d5e4
--- /dev/null
+++ b/src/sqlfluff/rules/L070.py
@@ -0,0 +1,216 @@
+"""Implementation of Rule L070."""
+from typing import Optional
+
+from sqlfluff.utils.analysis.select_crawler import Query, SelectCr... | {
"difficulty": "high",
"estimated_review_effort": 4,
"problem_domain": "New Feature Additions"
} |
sgl-project__sglang-4491@1fd6495 | sgl-project/sglang | Python | 4,491 | Add MMMU benchmark results | ## Motivation
PR to add MMMU benchmark results comparing SGLang and HuggingFace.
Update: I used some parts of #4509 to update the benchmarking.
### Related Issue
Fixes #4456
## Modifications
<!-- Describe the changes made in this PR. -->
## Checklist
- [ ] Format your code according to the [Code F... | 2025-03-17T06:03:30Z | [Track] VLM accuracy in MMMU benchmark
This issue keeps track of all vlm models accuracy in MMMU benchmark. Keep updating
``` python
python benchmark/mmmu/bench_sglang.py
python benchmark/mmmu/bench_hf.py --model-path model
```
| | sglang | hf |
|--|--|--|
| Qwen2-VL-7B-Instruct | 0.485 | 0.255 |
| Qwen2.5-VL-7B-In... | Hi, is anyone taking on this task? Would love to help. Are there any resources to get started with this? I am quite new to this project and willing to learn.
https://docs.sglang.ai/
@Vrushank17 start with sglang
Hi @Vrushank17, thanks a lot~ I think you could try to follow the instruction here https://github.com/sgl-p... | [
{
"body": "This issue keeps track of all vlm models accuracy in MMMU benchmark. Keep updating\n\n``` python\npython benchmark/mmmu/bench_sglang.py\npython benchmark/mmmu/bench_hf.py --model-path model\n\n```\n\n| | sglang | hf |\n|--|--|--|\n| Qwen2-VL-7B-Instruct | 0.485 | 0.255 |\n| Qwen2.5-VL-7B-Instruct | ... | d2b8d0b8d8a8b891e427dbfd62d8f56163f7d782 | {
"head_commit": "1fd64953596359907203431a6ab6c5ef3de0fcdd",
"head_commit_message": "change to python3",
"patch_to_review": "diff --git a/benchmark/mmmu/README.md b/benchmark/mmmu/README.md\nindex 00cdf1606f..604f8f27e6 100644\n--- a/benchmark/mmmu/README.md\n+++ b/benchmark/mmmu/README.md\n@@ -21,10 +21,3 @@ It'... | [
{
"diff_hunk": "@@ -0,0 +1,161 @@\n+import glob\n+import json\n+import os\n+import subprocess\n+import sys\n+import unittest\n+from types import SimpleNamespace\n+\n+from sglang.srt.utils import kill_process_tree\n+from sglang.test.test_utils import (\n+ DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,\n+ DEFAULT_URL_F... | e8c645d43a22620e47412f7d53777324e1429a8b | diff --git a/benchmark/mmmu/README.md b/benchmark/mmmu/README.md
index 00cdf1606f3..604f8f27e67 100644
--- a/benchmark/mmmu/README.md
+++ b/benchmark/mmmu/README.md
@@ -21,10 +21,3 @@ It's recommended to reduce the memory usage by appending something ike `--mem-fr
```
python benchmark/mmmu/bench_hf.py --model-path Qw... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Bug Fixes"
} |
scikit-learn__scikit-learn-25174@890ab9a | scikit-learn/scikit-learn | Python | 25,174 | FIX Ensure dtype of categories is `object` for strings in `OneHotEncoder` | <!--
Thanks for contributing a pull request! Please ensure you have taken a look at
the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md
-->
#### Reference Issues/PRs
<!--
Example: Fixes #1234. See also #3456.
Please use keywords (e.g., Fixes) to create link to th... | 2022-12-12T10:47:20Z | OneHotEncoder cuts predefined classes
### Describe the bug
When having predefined categories for the OneHotEncoder the categories get cut off. This lead to an error when trying to transform samples with the categories present....
### Steps/Code to Reproduce
```python
from sklearn.preprocessing import OneHotEn... | I think this happens because we convert the category for each feature to the dtype of the input ([on this line](https://github.com/scikit-learn/scikit-learn/blob/754bd5245aa46b89a1d686a3326c2b853012ff3e/sklearn/preprocessing/_encoders.py#L100)).
In this case `<U2` is used because the input is a two character string.... | [
{
"body": "### Describe the bug\r\n\r\nWhen having predefined categories for the OneHotEncoder the categories get cut off. This lead to an error when trying to transform samples with the categories present....\r\n\r\n### Steps/Code to Reproduce\r\n\r\n```python\r\nfrom sklearn.preprocessing import OneHotEncoder... | 205f3b76ef8500c90c346c6c6fb6f4e589368278 | {
"head_commit": "890ab9add5da9a5b3f7c4a20fdf8604f7451fa8d",
"head_commit_message": "Add explicit test for mixed string-bytes categories",
"patch_to_review": "diff --git a/sklearn/preprocessing/_encoders.py b/sklearn/preprocessing/_encoders.py\nindex f7f82c3b728a7..5f637a8e76876 100644\n--- a/sklearn/preprocessin... | [
{
"diff_hunk": "@@ -1376,6 +1376,22 @@ def test_encoders_string_categories(input_dtype, category_dtype, array_type):\n assert_array_equal(X_trans, expected)\n \n \n+def test_mixed_string_bytes_categoricals():\n+ \"\"\"Check that this mixture of predefined categries and X raises an error.",
"line": nu... | 445fd784dedfa937aba2a1924a8aa03ae9eeefc0 | diff --git a/doc/whats_new/v1.3.rst b/doc/whats_new/v1.3.rst
index 68a569acb14e5..eb0457431372c 100644
--- a/doc/whats_new/v1.3.rst
+++ b/doc/whats_new/v1.3.rst
@@ -19,6 +19,11 @@ parameters, may produce different models from the previous version. This often
occurs due to changes in the modelling logic (bug fixes or e... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
scikit-learn__scikit-learn-25299@f3261bd | scikit-learn/scikit-learn | Python | 25,299 | FIX renormalization of y_pred inside log_loss | <!--
Thanks for contributing a pull request! Please ensure you have taken a look at
the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md
-->
#### Reference Issues/PRs
<!--
Example: Fixes #1234. See also #3456.
Please use keywords (e.g., Fixes) to create link to th... | 2023-01-05T07:16:22Z | BUG log_loss renormalizes the predictions
### Describe the bug
`log_loss(y_true, y_pred)` renormalizes `y_pred` internally such that it sums to 1. This way, a really bad model, the predictions of which do not sum to 1, gets a better loss then it actually has.
### Steps/Code to Reproduce
```python
from scipy.special... | can u share me the refernce of the code where the bug was there
@TomDLT I'd be interested in you opinion. We hit this in https://github.com/scikit-learn/scikit-learn/pull/24365#discussion_r976815764.
I feel like computing a log loss with probabilities not summing to one does not make sense, so I am ok with the renormal... | [
{
"body": "### Describe the bug\n\n`log_loss(y_true, y_pred)` renormalizes `y_pred` internally such that it sums to 1. This way, a really bad model, the predictions of which do not sum to 1, gets a better loss then it actually has.\n\n### Steps/Code to Reproduce\n\n```python\r\nfrom scipy.special import xlogy\r... | d9cfe3f6b1c58dd253dc87cb676ce5171ff1f8a1 | {
"head_commit": "f3261bdb93f43a269a9e9ae98ce1a3e077c7fbeb",
"head_commit_message": "Remove renormalization of y_pred inside log_loss",
"patch_to_review": "diff --git a/sklearn/metrics/_classification.py b/sklearn/metrics/_classification.py\nindex 9d1fd713f61c5..9dc828139d120 100644\n--- a/sklearn/metrics/_classi... | [
{
"diff_hunk": "@@ -2680,7 +2689,14 @@ def log_loss(\n \n # Renormalize\n y_pred_sum = y_pred.sum(axis=1)\n- y_pred = y_pred / y_pred_sum[:, np.newaxis]\n+ if (y_pred_sum != 1).any():\n+ warnings.warn(\n+ \"The y_pred values are not normalized. Starting from 1.3 this\"\n+ ... | 7c7a212ddcd0fb3691816161dd55bdcbaf138a92 | diff --git a/doc/whats_new/v1.3.rst b/doc/whats_new/v1.3.rst
index 3e5e5083dd708..e7cd4c1a0e19d 100644
--- a/doc/whats_new/v1.3.rst
+++ b/doc/whats_new/v1.3.rst
@@ -165,6 +165,13 @@ Changelog
- |Fix| :func:`metric.manhattan_distances` now supports readonly sparse datasets.
:pr:`25432` by :user:`Julien Jerphanion <j... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
scikit-learn__scikit-learn-25114@00ae1ce | scikit-learn/scikit-learn | Python | 25,114 | FIX ignore *args and **kwargs in parameter validation of public functions | closes #25113
Avoid including `*args` and `**kwargs` in the parameter validation.
Since the number of arguments is varying, we cannot create a constraint for them.
The idea is to filter them for the moment. | 2022-12-05T13:16:51Z | Handling `*args` and `**kwargs` in parameter validation framework
Currently, our parameter validation framework is not designed to work properly with `*args` (I did not test it) and `**kwargs` passed in a function.
If `kwargs` is not part of `validate_params`, we raise an error as a missing constraint. If we add it ... | [
{
"body": "Currently, our parameter validation framework is not designed to work properly with `*args` (I did not test it) and `**kwargs` passed in a function.\r\n\r\nIf `kwargs` is not part of `validate_params`, we raise an error as a missing constraint. If we add it in the constraint then `kwargs` is actually... | cbfb6aba29e6d35fc0c3fb215b5ca114ff7207f5 | {
"head_commit": "00ae1cec618f1fa8de7f96735c342adce20b5844",
"head_commit_message": "fix",
"patch_to_review": "diff --git a/sklearn/model_selection/_split.py b/sklearn/model_selection/_split.py\nindex 61e2caa4ca7fa..476c1719f7b0d 100644\n--- a/sklearn/model_selection/_split.py\n+++ b/sklearn/model_selection/_spli... | [
{
"diff_hunk": "@@ -39,8 +40,13 @@ def test_function_param_validation(func_module):\n parameter_constraints = getattr(func, \"_skl_parameter_constraints\")\n \n # generate valid values for the required parameters\n+ # Generate valid values for the required parameters",
"line": null,
"original... | fdb0b1592ce00724d5c54245006c4da04dd7816a | diff --git a/sklearn/model_selection/_split.py b/sklearn/model_selection/_split.py
index 61e2caa4ca7fa..fa83afa6378c7 100644
--- a/sklearn/model_selection/_split.py
+++ b/sklearn/model_selection/_split.py
@@ -28,6 +28,7 @@
from ..utils.validation import _num_samples, column_or_1d
from ..utils.validation import check_... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} | |
sgl-project__sglang-2513@a8b28a2 | sgl-project/sglang | Python | 2,513 | Add generator-style run_batch function | This PR adds a new `generator_style` parameter to `run_batch` that allows yielding results as they become available, while maintaining the performance benefits of batch processing. This is particularly useful when you want to process results as soon as they are ready, for example to save them to disk.
### Changes
... | 2024-12-18T20:01:56Z | generator-style `run_batch`
`run_batch` is great for performance but you also give up control during the iteration. For instance, you might want to save the results to disk as soon as they come in while also getting the performance benefits of `run_batch`. A simple solution is to modify `run_batch` to act as a generato... | This issue has been automatically closed due to inactivity. Please feel free to reopen it if needed. | [
{
"body": "`run_batch` is great for performance but you also give up control during the iteration. For instance, you might want to save the results to disk as soon as they come in while also getting the performance benefits of `run_batch`. A simple solution is to modify `run_batch` to act as a generator that yi... | 287427e2e66aef4e4d857cfd666fe849e9f73617 | {
"head_commit": "a8b28a29b0ce92a197e851810fc493ca32c33e8a",
"head_commit_message": "Simplify generator-style run_batch to only yield results\n\nAs suggested in the issue, we don't need to return the arguments with each\nresult. The user can maintain their own mapping if needed.",
"patch_to_review": "diff --git a... | [
{
"diff_hunk": "@@ -110,62 +111,63 @@ def run_program_batch(\n num_threads = min(num_threads, len(batch_arguments))\n \n if num_threads == 1:\n- rets = []\n- if progress_bar:\n- for arguments in tqdm.tqdm(batch_arguments):\n- rets.append(\n- run... | 83d9a60de2f6b6eafba49290de6202ea7b960c9b | diff --git a/python/sglang/lang/interpreter.py b/python/sglang/lang/interpreter.py
index 55a20336bc7..6d1ca71adab 100644
--- a/python/sglang/lang/interpreter.py
+++ b/python/sglang/lang/interpreter.py
@@ -96,6 +96,7 @@ def run_program_batch(
default_sampling_para,
num_threads,
progress_bar,
+ generato... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} |
scikit-learn__scikit-learn-25093@11ccc95 | scikit-learn/scikit-learn | Python | 25,093 | ENH Adds FeatureUnion.__getitem__ to access transformers | <!--
Thanks for contributing a pull request! Please ensure you have taken a look at
the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md
-->
#### Reference Issues/PRs
<!--
Example: Fixes #1234. See also #3456.
Please use keywords (e.g., Fixes) to create link to th... | 2022-12-01T21:07:52Z | Add __get_item__() to FeatureUnion
### Describe the bug
When debugging larger pipelines for a consistent syntax we’d like to reference individual sub components of `FeatureUnion` by index, slice or tuple name in the same way as the `Pipeline`. This way user does not need to know the types of the aggregate component... | Looks like a nice UX improvement to me.
Would be similar to `Pipeline`, would be nice to have. | [
{
"body": "### Describe the bug\r\n\r\nWhen debugging larger pipelines for a consistent syntax we’d like to reference individual sub components of `FeatureUnion` by index, slice or tuple name in the same way as the `Pipeline`. This way user does not need to know the types of the aggregate components.\r\n\r\n\r\... | b01f018c9b4e963d3b897906fd90a5de42c1a6b8 | {
"head_commit": "11ccc95169a8e290695e711395021377765abd58",
"head_commit_message": "DOC Adds whats new number",
"patch_to_review": "diff --git a/doc/whats_new/v1.3.rst b/doc/whats_new/v1.3.rst\nindex 6012ac7a336a4..a7838f7c2ec8f 100644\n--- a/doc/whats_new/v1.3.rst\n+++ b/doc/whats_new/v1.3.rst\n@@ -36,6 +36,12 ... | [
{
"diff_hunk": "@@ -1658,3 +1658,21 @@ def test_feature_union_set_output():\n assert isinstance(X_trans, pd.DataFrame)\n assert_array_equal(X_trans.columns, union.get_feature_names_out())\n assert_array_equal(X_trans.index, X_test.index)\n+\n+\n+def test_feature_union_getitem():\n+ \"\"\"Check Fe... | 07c55cc44a9fc849b10a05477d4aeb57936ac870 | diff --git a/doc/whats_new/v1.3.rst b/doc/whats_new/v1.3.rst
index 6012ac7a336a4..a7838f7c2ec8f 100644
--- a/doc/whats_new/v1.3.rst
+++ b/doc/whats_new/v1.3.rst
@@ -36,6 +36,12 @@ Changelog
:pr:`123456` by :user:`Joe Bloggs <joeongithub>`.
where 123456 is the *pull request* number, not the issue number.
+:m... | {
"difficulty": "low",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} |
scikit-learn__scikit-learn-23772@c0769d6 | scikit-learn/scikit-learn | Python | 23,772 | MAINT Add one-sided set differences for clarity in param validation | #### Reference Issues/PRs
Fixes #23744
#### What does this implement/fix? Explain your changes.
Add one-sided set differences for clarity in param validation
#### Any other comments? | 2022-06-27T17:09:55Z | Add set difference to `validate_parameter_constraints` `ValueError`
### Describe the workflow you want to enable
Currently the `ValueError` protuced by `validate_parameter_constraints` can get very long and unruly when there are a lot of validation parameters in either the passed constraints, or in the params to be va... | @jeremiedbb Wondering your opinion on this
I felt the same difficulty while reviewing some PRs. I think this would be a good addition the common tests `check_param_validation` and `def test_function_param_validation` | [
{
"body": "### Describe the workflow you want to enable\n\nCurrently the `ValueError` protuced by `validate_parameter_constraints` can get very long and unruly when there are a lot of validation parameters in either the passed constraints, or in the params to be validated. This can make debugging a bit strained... | f0af898de5bfa93916b659438b4cf0b86fffd974 | {
"head_commit": "c0769d6c337b30dcb9c79052d1861d6806ca77cc",
"head_commit_message": "Addressed review",
"patch_to_review": "diff --git a/sklearn/tests/test_public_functions.py b/sklearn/tests/test_public_functions.py\nindex 20ab0665eec88..d4e645c052dab 100644\n--- a/sklearn/tests/test_public_functions.py\n+++ b/s... | [
{
"diff_hunk": "@@ -43,13 +43,20 @@ def validate_parameter_constraints(parameter_constraints, params, caller_name):\n caller_name : str\n The name of the estimator or function or method that called this function.\n \"\"\"\n- if params.keys() != parameter_constraints.keys():\n+ if len(set(p... | 562b64335e6a60e408e6f55880af48f6978e1e87 | diff --git a/sklearn/tests/test_public_functions.py b/sklearn/tests/test_public_functions.py
index 20ab0665eec88..d4e645c052dab 100644
--- a/sklearn/tests/test_public_functions.py
+++ b/sklearn/tests/test_public_functions.py
@@ -45,11 +45,15 @@ def test_function_param_validation(func_module):
# check that there ... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} |
scikit-learn__scikit-learn-23572@874a6f6 | scikit-learn/scikit-learn | Python | 23,572 | DOC Add warning for using `"kmeans++"` init with high-dimensional data | <!--
Thanks for contributing a pull request! Please ensure you have taken a look at
the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md
-->
#### Reference Issues/PRs
<!--
Example: Fixes #1234. See also #3456.
Please use keywords (e.g., Fixes) to create link to th... | 2022-06-09T13:48:43Z | `silhouette_score` fails whit `"k-means++"` init on very sparse data
### Describe the bug
Not sure this is a bug or something that just need to be better documented.
The `"k-means++"` init on very sparse data can select initial centroids than never get updated and this cause problems in the silhouette clustering ... | Since random_state is not set in KMeans in the reproducer, I can't reproduce it yet. We need to find a seed that trigger it
> Since random_state is not set in KMeans in the reproducer, I can't reproduce it yet. We need to find a seed that trigger it
I updated it.
Isn't it just bad luck ?
It just happens that it... | [
{
"body": "### Describe the bug\r\n\r\nNot sure this is a bug or something that just need to be better documented.\r\n\r\nThe `\"k-means++\"` init on very sparse data can select initial centroids than never get updated and this cause problems in the silhouette clustering evaluation with `sample_size=1000`.\r\n\... | 6db963ccaeb76dc79e0c7a64c9127de898f14299 | {
"head_commit": "874a6f6fff717582ed1edaa8014cccac6beaf5dc",
"head_commit_message": "Merge branch 'main' of https://github.com/scikit-learn/scikit-learn into warn_kmeans",
"patch_to_review": "diff --git a/sklearn/cluster/_kmeans.py b/sklearn/cluster/_kmeans.py\nindex 25cd8712c2f0c..1f77c8f8f7a67 100644\n--- a/skl... | [
{
"diff_hunk": "@@ -1663,9 +1663,8 @@ class MiniBatchKMeans(_BaseKMeans):\n (n_clusters, n_features), default='k-means++'\n Method for initialization:\n \n- 'k-means++' : selects initial cluster centers for k-mean\n- clustering in a smart way to speed up convergence. See sectio... | 25aed25569494489fc93b21fa1119da9d4d3877b | diff --git a/sklearn/cluster/_kmeans.py b/sklearn/cluster/_kmeans.py
index 25cd8712c2f0c..306dd839901cb 100644
--- a/sklearn/cluster/_kmeans.py
+++ b/sklearn/cluster/_kmeans.py
@@ -1188,9 +1188,11 @@ class KMeans(_BaseKMeans):
(n_clusters, n_features), default='k-means++'
Method for initialization... | {
"difficulty": "low",
"estimated_review_effort": 1,
"problem_domain": "Bug Fixes"
} |
scikit-learn__scikit-learn-23548@cc5e175 | scikit-learn/scikit-learn | Python | 23,548 | FIX Ensure correct sklearn.metrics.coverage_error error message for 1D array | <!--
Thanks for contributing a pull request! Please ensure you have taken a look at
the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md
-->
#### Reference Issues/PRs
<!--
Example: Fixes #1234. See also #3456.
Please use keywords (e.g., Fixes) to create link to th... | 2022-06-06T10:29:08Z | sklearn.metrics.coverage_error wrong error message for 1D array
### Describe the bug
Let y_true and y_score be numpy arrays of shape (K,),
when you try to run the "sklearn.metrics.coverage_error" as explained in the documentation
it returns "binary type not supported" error, but this is not the case at all, the me... | > Please either fix the function so that it can work with 1D array or please fix the error message.
I agree we should fix the error messages. I think it comes from the fact that the 2 calls `check_array(., ensure_2d=False)` at the beginning of `coverage_error` should be changes to `ensure_2d=True` instead. Some test... | [
{
"body": "### Describe the bug\r\n\r\nLet y_true and y_score be numpy arrays of shape (K,),\r\nwhen you try to run the \"sklearn.metrics.coverage_error\" as explained in the documentation\r\nit returns \"binary type not supported\" error, but this is not the case at all, the metric works with,\r\nbinary, the p... | 7d9bc179e7c222c6dc70750c840099f242e09a80 | {
"head_commit": "cc5e1752a11e4d26e5ef2553877127573f0072c5",
"head_commit_message": "Modify 1D error message test",
"patch_to_review": "diff --git a/sklearn/metrics/_ranking.py b/sklearn/metrics/_ranking.py\nindex 7f64f479ed275..9e746f167381f 100644\n--- a/sklearn/metrics/_ranking.py\n+++ b/sklearn/metrics/_ranki... | [
{
"diff_hunk": "@@ -1569,6 +1569,13 @@ def test_coverage_tie_handling():\n assert_almost_equal(coverage_error([[1, 1, 1]], [[0.25, 0.5, 0.5]]), 3)\n \n \n+def test_coverage_1d_error_message():\n+ with pytest.raises(ValueError, match=r\"Expected 2D array, got 1D array instead\"):\n+ coverage_error(... | 2c54c51ccffb4737312b0eaca9fe8f7a166c5108 | diff --git a/doc/whats_new/v1.2.rst b/doc/whats_new/v1.2.rst
index ede154619526e..d93c7bb698ea6 100644
--- a/doc/whats_new/v1.2.rst
+++ b/doc/whats_new/v1.2.rst
@@ -119,6 +119,9 @@ Changelog
of a binary classification problem. :pr:`22518` by
:user:`Arturo Amor <ArturoAmorQ>`.
+- |Fix| Fixed error message of :cl... | {
"difficulty": "low",
"estimated_review_effort": 2,
"problem_domain": "Bug Fixes"
} |
scikit-learn__scikit-learn-23370@1dde56f | scikit-learn/scikit-learn | Python | 23,370 | ENH PolynomialFeatures better handle degree=0 | <!--
Thanks for contributing a pull request! Please ensure you have taken a look at
the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md
-->
#### Reference Issues/PRs
<!--
Example: Fixes #1234. See also #3456.
Please use keywords (e.g., Fixes) to create link to th... | 2022-05-14T07:16:50Z | PolynomialFeatures doesn't work correctly when degree=0
#### Describe the bug
PolynomialFeatures.transform fails when degree=0 and the input has more than one column.
#### Steps/Code to Reproduce
```python
from sklearn.preprocessing import PolynomialFeatures
PolynomialFeatures(degree=0, include_bias=True).fit_... | Why should we allow degree=0? I suspect we should raise an explicit error for degree <1
Take
Seems pretty easy so I'd like to work on it
> Why should we allow degree=0? I suspect we should raise an explicit error for degree <1
Maybe one could argue that, for educational purpose, it could be interesting to generate a... | [
{
"body": "#### Describe the bug\r\nPolynomialFeatures.transform fails when degree=0 and the input has more than one column.\r\n\r\n#### Steps/Code to Reproduce\r\n\r\n```python\r\nfrom sklearn.preprocessing import PolynomialFeatures\r\nPolynomialFeatures(degree=0, include_bias=True).fit_transform(np.ones((10,1... | 6f95739e0ca0624d290853645d6d854837ee8d8a | {
"head_commit": "1dde56f6b8e9a114b1f0b8f960456c6f2268b4ad",
"head_commit_message": "raise error for PolynomialFeature when include_bias=False and degree=0",
"patch_to_review": "diff --git a/sklearn/preprocessing/_polynomial.py b/sklearn/preprocessing/_polynomial.py\nindex 09306cc56ab11..f8b67ad2b1cea 100644\n---... | [
{
"diff_hunk": "@@ -291,6 +291,13 @@ def fit(self, X, y=None):\n raise ValueError(\n f\"degree must be a non-negative integer, got {self.degree}.\"\n )\n+\n+ if self.degree == 0 and not self.include_bias:",
"line": null,
"original_line": 295... | cb874a378e89fdd96f1335c41f7833cbc8af21fb | diff --git a/doc/whats_new/v1.2.rst b/doc/whats_new/v1.2.rst
index 561eaa17bca6f..a447ed22a2b2c 100644
--- a/doc/whats_new/v1.2.rst
+++ b/doc/whats_new/v1.2.rst
@@ -85,6 +85,13 @@ Changelog
matrices in a variety of estimators and avoid an `EfficiencyWarning`.
:pr:`23139` by `Tom Dupre la Tour`_.
+:mod:`sklearn.... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
scikit-learn__scikit-learn-23252@036bed9 | scikit-learn/scikit-learn | Python | 23,252 | ENH Optimize runtime for IsolationForest | <!--
Thanks for contributing a pull request! Please ensure you have taken a look at
the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md
-->
#### Reference Issues/PRs
<!--
Example: Fixes #1234. See also #3456.
Please use keywords (e.g., Fixes) to create link to th... | 2022-04-30T07:40:49Z | IsolationForest extremely slow with large number of columns having discrete values
The following example takes an unreasonable amount of time to run:
```python
import numpy as np
from sklearn.ensemble import IsolationForest
from sklearn.datasets import fetch_rcv1
from scipy.sparse import csc_matrix, csr_matrix
... | Here is an edited version of your reproducer to get more precise measurements:
```python
import sys
import os
import pickle
import numpy as np
from time import perf_counter
from sklearn.ensemble import IsolationForest
from sklearn.datasets import fetch_rcv1
from scipy.sparse import csc_matrix, csr_matrix
... | [
{
"body": "The following example takes an unreasonable amount of time to run:\r\n```python\r\nimport numpy as np\r\nfrom sklearn.ensemble import IsolationForest\r\nfrom sklearn.datasets import fetch_rcv1\r\nfrom scipy.sparse import csc_matrix, csr_matrix\r\n\r\nX, y = fetch_rcv1(return_X_y=True)\r\nX = csc_matr... | 93359b645d1c47e3c787821cf276ec486451dcac | {
"head_commit": "036bed9a72885726ad6dd92a27e9b16a26120f87",
"head_commit_message": "fix merge conflict",
"patch_to_review": "diff --git a/doc/whats_new/v1.2.rst b/doc/whats_new/v1.2.rst\nindex 5f45cdf6a7168..e409461bccc77 100644\n--- a/doc/whats_new/v1.2.rst\n+++ b/doc/whats_new/v1.2.rst\n@@ -44,6 +44,12 @@ Chan... | [
{
"diff_hunk": "@@ -347,3 +347,12 @@ def test_n_features_deprecation():\n \n with pytest.warns(FutureWarning, match=\"`n_features_` was deprecated\"):\n est.n_features_\n+\n+\n+def test_iforest_with_n_jobs():\n+ \"\"\"This is a non-regression test for PR #23252\"\"\"\n+ X, _ = make_classificat... | 50165ead481913fa4203f29cf8f339b0c0b6d1a5 | diff --git a/doc/whats_new/v1.2.rst b/doc/whats_new/v1.2.rst
index 5f45cdf6a7168..e409461bccc77 100644
--- a/doc/whats_new/v1.2.rst
+++ b/doc/whats_new/v1.2.rst
@@ -44,6 +44,12 @@ Changelog
- |Enhancement| :class:`cluster.Birch` now preserves dtype for `numpy.float32`
inputs. :pr:`22968` by `Meekail Zain <micky774>... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Performance Optimizations"
} |
scikit-learn__scikit-learn-23194@b952e7a | scikit-learn/scikit-learn | Python | 23,194 | ENH Improves error message when experimental flag is not imported | <!--
Thanks for contributing a pull request! Please ensure you have taken a look at
the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md
-->
#### Reference Issues/PRs
<!--
Example: Fixes #1234. See also #3456.
Please use keywords (e.g., Fixes) to create link to th... | 2022-04-22T20:32:44Z | Experimental error message
```py
# from sklearn.experimental import enable_hist_gradient_boosting
from sklearn.ensemble import HistGradientBoostingRegressor
```
gives
```sh
---------------------------------------------------------------------------
ImportError Traceback (most re... | It would be quite hard to make this foolproof. You'd need an import hook
and something to handle attribute access. I don't think it's warranted.
Do you think it is worth the effort? otherwise, feel free to close.
Yeah that's one of the main downsides of this solution.
As Joel said, it's very hard to have a custom e... | [
{
"body": "```py\r\n# from sklearn.experimental import enable_hist_gradient_boosting\r\nfrom sklearn.ensemble import HistGradientBoostingRegressor\r\n```\r\ngives \r\n\r\n```sh\r\n---------------------------------------------------------------------------\r\nImportError Traceback (... | 4942ba76eb068bc96b2f7970f42797f7c6d0ec23 | {
"head_commit": "b952e7a243b0b06546fb22759d2f6f291b5f63de",
"head_commit_message": "CLN Move all experimental import logic into __getattr__",
"patch_to_review": "diff --git a/doc/whats_new/v1.1.rst b/doc/whats_new/v1.1.rst\nindex 840abe0a45358..3f3431c8688aa 100644\n--- a/doc/whats_new/v1.1.rst\n+++ b/doc/whats_... | [
{
"diff_hunk": "@@ -18,16 +18,3 @@\n The ``# noqa`` comment comment can be removed: it just tells linters like\n flake8 to ignore the import, which appears as unused.\n \"\"\"\n-\n-from ..model_selection._search_successive_halving import (\n- HalvingRandomSearchCV,\n- HalvingGridSearchCV,\n-)\n-\n-from ..... | e7c6baceb51b702c13798b57869aacb75d19ecf0 | diff --git a/doc/whats_new/v1.1.rst b/doc/whats_new/v1.1.rst
index c4d8bd8e8fe70..e054ee930a391 100644
--- a/doc/whats_new/v1.1.rst
+++ b/doc/whats_new/v1.1.rst
@@ -164,6 +164,12 @@ Changelog
:func:`sklearn.set_config`.
:pr:`22856` by :user:`Jérémie du Boisberranger <jeremiedbb>`.
+- |Enhancement| The error mes... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
scikit-learn__scikit-learn-23210@76e6e4a | scikit-learn/scikit-learn | Python | 23,210 | ENH propagate `eigen_tol` to all eigen solver | #### Reference Issues/PRs
closes https://github.com/scikit-learn/scikit-learn/issues/21243
Resolves #11968 (stalled)
#### What does this implement/fix? Explain your changes.
PR #11968: Propagate the `eigen_tol` for the 'arpack', 'amg', and 'lobpcg' solvers.
This PR:
- Adds tests
#### Any other comments?... | 2022-04-24T21:57:12Z | eigen_tol in _spectral_embedding.py does not propagate to solvers other than arpack
### Describe the bug
In `_spectral_embedding.py` the option
```
eigen_tol : float, default=0.0
Stopping criterion for eigendecomposition of the Laplacian matrix
when ``eigen_solver='arpack'``.
```
does not ... | Currently, `eigen_tol` is different between solvers i.e. `logpcg` uses `1e-5` and arpack uses `0.0`. Should the solvers have different default tolerances?
1. The solvers should ideally have the same default accuracy, but `arpack` and `lobpcg` likely have different stopping criteria, so it may need some testing to figur... | [
{
"body": "### Describe the bug\r\n\r\nIn `_spectral_embedding.py` the option \r\n```\r\n eigen_tol : float, default=0.0\r\n Stopping criterion for eigendecomposition of the Laplacian matrix\r\n when ``eigen_solver='arpack'``.\r\n```\r\ndoes not appear to propagate to solvers 'amg' and 'lobpcg'... | 8ea2997dfcd72126cdd6793a2c5293406407b1dc | {
"head_commit": "76e6e4a0261c90b9a79509db04e9b3c5506fcd84",
"head_commit_message": "Address review feedback",
"patch_to_review": "diff --git a/doc/whats_new/v1.2.rst b/doc/whats_new/v1.2.rst\nindex 5851100a358c5..10f4451afcbfb 100644\n--- a/doc/whats_new/v1.2.rst\n+++ b/doc/whats_new/v1.2.rst\n@@ -19,6 +19,12 @@... | [
{
"diff_hunk": "@@ -480,3 +483,29 @@ def test_error_pyamg_not_available():\n err_msg = \"The eigen_solver was set to 'amg', but pyamg is not available.\"\n with pytest.raises(ValueError, match=err_msg):\n se_precomp.fit_transform(S)\n+\n+\n+@pytest.mark.parametrize(\"solver\", [\"arpack\", \"amg... | 2d8107c3e366934245c05901b96cef15673a2c4c | diff --git a/doc/whats_new/v1.2.rst b/doc/whats_new/v1.2.rst
index e4e2a08ea27f0..ede154619526e 100644
--- a/doc/whats_new/v1.2.rst
+++ b/doc/whats_new/v1.2.rst
@@ -19,6 +19,12 @@ parameters, may produce different models from the previous version. This often
occurs due to changes in the modelling logic (bug fixes or e... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
scikit-learn__scikit-learn-23113@26a0dd4 | scikit-learn/scikit-learn | Python | 23,113 | FIX: fetch covtype dataset concurrent-safe | <!--
Thanks for contributing a pull request! Please ensure you have taken a look at
the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md
-->
#### Reference Issues/PRs
<!--
Example: Fixes #1234. See also #3456.
Please use keywords (e.g., Fixes) to create link to th... | 2022-04-11T21:27:34Z | Covtype dataset raises error when fetching
### Describe the bug
When fetching the Covtype dataset
```python
from sklearn.datasets import fetch_covtype
fetch_covtype()
```
I am getting an
```python
error: Error -3 while decompressing data: invalid block type
```
Renaming the folder `$HOME/scikit_learn_... | By looking at the source code of `fetch_covtype`, it appears that this code is not concurrent safe: it does not use the typical "download and save to a temporary file" followed by "atomic rename to the final filepath".
This can explain that we can get corrupted covtype data, for instance by running the test with pyt... | [
{
"body": "### Describe the bug\r\n\r\nWhen fetching the Covtype dataset\r\n```python\r\nfrom sklearn.datasets import fetch_covtype\r\nfetch_covtype()\r\n```\r\n\r\nI am getting an\r\n\r\n```python\r\nerror: Error -3 while decompressing data: invalid block type\r\n```\r\n\r\nRenaming the folder `$HOME/scikit_le... | e275d9df3da36352605f4e68b14593bf9f435c9b | {
"head_commit": "26a0dd46b1046110b1134169c45c7ec764523cf1",
"head_commit_message": "add concurrent-safe covtype fetching",
"patch_to_review": "diff --git a/sklearn/datasets/_covtype.py b/sklearn/datasets/_covtype.py\nindex c9f5291de153b..726cdebdac6af 100644\n--- a/sklearn/datasets/_covtype.py\n+++ b/sklearn/dat... | [
{
"diff_hunk": "@@ -148,23 +149,29 @@ def fetch_covtype(\n covtype_dir = join(data_home, \"covertype\")\n samples_path = _pkl_filepath(covtype_dir, \"samples\")\n targets_path = _pkl_filepath(covtype_dir, \"targets\")\n- available = exists(samples_path)\n+ available = exists(samples_path) and ... | bfb52d4b7586ff2b966cb762050ed5fdc98e4a16 | diff --git a/doc/whats_new/v1.1.rst b/doc/whats_new/v1.1.rst
index 317ac794649ea..762c79cb344c2 100644
--- a/doc/whats_new/v1.1.rst
+++ b/doc/whats_new/v1.1.rst
@@ -281,6 +281,10 @@ Changelog
:pr:`19747` by :user:`Tony Attalla <tonyattalla>` and :pr:`22498` by
:user:`Meekail Zain <micky774>`.
+- |Fix| :func:`da... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
scikit-learn__scikit-learn-23470@2242749 | scikit-learn/scikit-learn | Python | 23,470 | MNT Deprecate `affinity` in `AgglomerativeClustering` | #### Reference Issues/PRs
Resolves #13945
#### What does this implement/fix? Explain your changes.
Deprecates `affinity` in favor of `metric` in `AgglomerativeClustering`
#### Any other comments?
Probably worth propagating the deprecation to `linkage_tree` in a follow-up PR. | 2022-05-26T15:44:18Z | [AgglomerativeClustering] confusing parameter 'affinity'
The name of the parameter 'affinity' is misleading, since it does not correspond to similarity/affinity functions, but to distance functions.
Besides, the documentation for the parameter 'affinity' seems wrong.
> Metric used to compute the linkage. Can be “... | Yes, I think we've been aware of this for a long time. I suspect you're
right that we should "bite the bullet" and rename it to `metric`, with
deprecation of course. | [
{
"body": "The name of the parameter 'affinity' is misleading, since it does not correspond to similarity/affinity functions, but to distance functions.\r\n\r\nBesides, the documentation for the parameter 'affinity' seems wrong.\r\n\r\n> Metric used to compute the linkage. Can be “euclidean”, “l1”, “l2”, “manha... | ae51c13af76af206e6815d0ca0d0052f73167caa | {
"head_commit": "2242749e6b37c850b6768587f05a692016d919fb",
"head_commit_message": "Addressed reviewer feedback",
"patch_to_review": "diff --git a/doc/whats_new/v1.2.rst b/doc/whats_new/v1.2.rst\nindex ede154619526e..5e43e7fea8b92 100644\n--- a/doc/whats_new/v1.2.rst\n+++ b/doc/whats_new/v1.2.rst\n@@ -85,6 +85,1... | [
{
"diff_hunk": "@@ -930,6 +945,16 @@ def _fit(self, X):\n \"\"\"\n memory = check_memory(self.memory)\n \n+ self._metric = self.metric\n+ # TODO(1.4): Remove\n+ if self.affinity != \"deprecated\":\n+ warnings.warn(\n+ \"Attribute `affinity` was depr... | 43ff645f193a33423c7119c297a7b0e7b03c5280 | diff --git a/doc/whats_new/v1.2.rst b/doc/whats_new/v1.2.rst
index 832a4e4389b19..f27ef98dfcdb0 100644
--- a/doc/whats_new/v1.2.rst
+++ b/doc/whats_new/v1.2.rst
@@ -91,6 +91,10 @@ Changelog
`eigen_tol="auto"` in version 1.3.
:pr:`23210` by :user:`Meekail Zain <micky774>`.
+- |API| The `affinity` attribute is no... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Documentation Updates"
} |
scikit-learn__scikit-learn-26120@486a2bd | scikit-learn/scikit-learn | Python | 26,120 | FEA add TunedThresholdClassifier meta-estimator to post-tune the cut-off threshold | superseded #16525
closes #16525
closes https://github.com/scikit-learn/scikit-learn/issues/8614
closes https://github.com/scikit-learn/scikit-learn/pull/10117
supersedes https://github.com/scikit-learn/scikit-learn/pull/10117
build upon https://github.com/scikit-learn/scikit-learn/pull/26037
relates to #4813... | 2023-04-07T12:03:09Z | Add wrapper class that changes threshold value for predict
This was discussed before, but not sure if there's an issue.
We should have a wrapper class that changes the decision threshold based on a cross-validation (or hold-out, pre-fit) estimate.
This is very very common so I think we should have a built-in solution... | Belongs in sklearn.calibration?
On 20 March 2017 at 09:47, Andreas Mueller <notifications@github.com> wrote:
> This was discussed before, but not sure if there's an issue.
> We should have a wrapper class that changes the decision threshold based
> on a cross-validation (or hold-out, pre-fit) estimate.
> This is very... | [
{
"body": "This was discussed before, but not sure if there's an issue.\r\nWe should have a wrapper class that changes the decision threshold based on a cross-validation (or hold-out, pre-fit) estimate.\r\nThis is very very common so I think we should have a built-in solution.\r\nSimple rules for selecting a ne... | f61dd6cfc0263e4f6b8f9f223ce1bc3510328057 | {
"head_commit": "486a2bdcd3bbe2cb9cb2321d857c50d4880d5ad5",
"head_commit_message": "Update sklearn/metrics/_scorer.py\n\nCo-authored-by: Christian Lorentzen <lorentzen.ch@gmail.com>",
"patch_to_review": "diff --git a/doc/model_selection.rst b/doc/model_selection.rst\nindex 25cd2b655ccc5..3a46315e65156 100644\n--... | [
{
"diff_hunk": "@@ -363,6 +377,62 @@ def _factory_args(self):\n return \", needs_threshold=True\"\n \n \n+class _ContinuousScorer(_BaseScorer):\n+ \"\"\"Scorer taking a continuous response and output a score for each threshold.\"\"\"\n+\n+ def __init__(self, score_func, sign, response_method, kwar... | 9bd68e6dec16aa265245f7ebb2765cd6c84cf095 | diff --git a/doc/model_selection.rst b/doc/model_selection.rst
index 25cd2b655ccc5..522544aefc820 100644
--- a/doc/model_selection.rst
+++ b/doc/model_selection.rst
@@ -14,5 +14,6 @@ Model selection and evaluation
modules/cross_validation
modules/grid_search
+ modules/classification_threshold
module... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "New Feature Additions"
} |
scikit-learn__scikit-learn-22997@8ca571b | scikit-learn/scikit-learn | Python | 22,997 | DOC fix docstring of EllipticEnvelope.fit | This commit updates the `fit(X, y)` definition, in the docs, of the `sklearn.covariance.EllipticEnvelope` class. The original definition stated that parameter X could be of type `'array-like'` or `'sparse matrix'`, however, an error would be thrown if a 'sparse matrix' is passed (`TypeError: A sparse matrix was passed... | 2022-03-30T13:57:33Z | EllipticEnvelope does not work with a sparse matrix
The documentation for EllipticEnvelope fit method says:
> X : numpy array or sparse matrix, shape (n_samples, n_features).
However, when trying to fit with a sparse CSR matrix, an exception is thrown:
> TypeError: A sparse matrix was passed, but dense data is... | Hi @kjanko , I'm sorry your issue got lost.... Please provide [self-contained example code](https://scikit-learn.org/dev/developers/minimal_reproducer.html#minimal-reproducer), including imports and data (if possible), so that other contributors can just run it and reproduce your issue. Ideally your example code should... | [
{
"body": "The documentation for EllipticEnvelope fit method says:\r\n\r\n> X : numpy array or sparse matrix, shape (n_samples, n_features).\r\n\r\nHowever, when trying to fit with a sparse CSR matrix, an exception is thrown:\r\n\r\n> TypeError: A sparse matrix was passed, but dense data is required. Use X.tode... | 24ef3881d7554ff478d295df3795603b40ef164d | {
"head_commit": "8ca571b13650be0a08c2ec6c8529a7989e2da7b6",
"head_commit_message": "Merge branch 'docs_refactor_EllipticEnvelope_fit' into main\n\nThis commit is part of the process to update the docs on the sklearn.covariance.EllipticEnvelope class's\nfit(X, y) definition, as explained in issue #14613.",
"patch... | [
{
"diff_hunk": "@@ -160,7 +160,7 @@ def fit(self, X, y=None):\n \n Parameters\n ----------\n- X : {array-like, sparse matrix} of shape (n_samples, n_features)\n+ X : {array-like} of shape (n_samples, n_features)",
"line": null,
"original_line": 163,
"original_start_line... | e6826866b999bc541f06dc1026256932e28a9380 | diff --git a/sklearn/covariance/_elliptic_envelope.py b/sklearn/covariance/_elliptic_envelope.py
index 569e478e38ff4..31f76fc30ca30 100644
--- a/sklearn/covariance/_elliptic_envelope.py
+++ b/sklearn/covariance/_elliptic_envelope.py
@@ -160,7 +160,7 @@ def fit(self, X, y=None):
Parameters
----------... | {
"difficulty": "low",
"estimated_review_effort": 1,
"problem_domain": "Bug Fixes"
} |
saltstack__salt-66878@32cbc18 | saltstack/salt | Python | 66,878 | Salt-ssh can deploy a relenv environment | ### What does this PR do?
This PR adds a new `--relenv` option to `salt-ssh` that deploys a relenv (onedir) bundled version of Salt and Python on the SSH target. The `--relenv` option works similarly to `--thin` but deploys a bundled Salt environment for cases where it’s preferable to use relenv.
### What issues do... | 2024-09-10T18:10:39Z | [FEATURE REQUEST] Add `--relenv` Option to `salt-ssh` for Using a Onedir Bundled Version of Salt+Python
**Summary:**
This feature request proposes adding a `--relenv` option to `salt-ssh` that allows downloading and using a bundled version of Salt and Python (relenv) on the SSH target, similar to how the `--thin` op... | **Implementation Discussion:**
Question: Should we re-use the `--thin` options for the deploy directory when using `--relenv`, or should we create completely separate options for relenv deployment?
- The options will be mutually exclusive, meaning you'll either use `--thin` or `--relenv`, not both simultaneously.... | [
{
"body": "**Summary:**\r\n\r\nThis feature request proposes adding a `--relenv` option to `salt-ssh` that allows downloading and using a bundled version of Salt and Python (relenv) on the SSH target, similar to how the `--thin` option works. This will serve as a transitional feature towards making `relenv` the... | 15573a8f203f0ee7f5dbd9c55e05c9e1b197f664 | {
"head_commit": "32cbc188f508766b77a8ce33c70d0054b3f97cac",
"head_commit_message": "Allow fstring linting",
"patch_to_review": "diff --git a/.pylintrc b/.pylintrc\nindex 5404f6522d0d..1d8f8e512707 100644\n--- a/.pylintrc\n+++ b/.pylintrc\n@@ -452,6 +452,7 @@ disable=R,\n line-too-long,\n locally-disabled,\n ... | [
{
"diff_hunk": "@@ -163,6 +163,28 @@ def test_thin_dir(salt_ssh_cli):\n assert thin_dir.joinpath(\"running_data\").exists()\n \n \n+def test_relenv_dir(salt_ssh_cli):\n+ \"\"\"\n+ test to make sure thin_dir is created\n+ and salt-call file is included\n+ \"\"\"\n+ ret = salt_ssh_cli.run(\"--r... | 2e5d086cfb1e3b1bc9a0a7477d5f98f7d593ab82 | diff --git a/.pylintrc b/.pylintrc
index 5404f6522d0d..1d8f8e512707 100644
--- a/.pylintrc
+++ b/.pylintrc
@@ -452,6 +452,7 @@ disable=R,
line-too-long,
locally-disabled,
logging-format-interpolation,
+ logging-fstring-interpolation,
missing-docstring,
no-member,
protected-access,
diff --git a/change... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "New Feature Additions"
} |
scikit-learn__scikit-learn-22866@19501e5 | scikit-learn/scikit-learn | Python | 22,866 | API get_scorer returns a copy and introduce get_scorer_names | __EDIT__: This PR now introduces a new `get_scorer_names`, makes `get_metric` to return a copy, and deprecated `SCORERS`.
__OLD__:
This PR makes `SCORERS[scorer_name]` to return a copy rather than the original object. This also means `get_scorer` returns a copy each time.
cc @thomasjpfan @jnothman @glemaitre @... | 2022-03-16T16:29:31Z | Should get_scorer return a deep copy of the scorer object
I stumble in something that I am wondering if this is an issue:
```python
scorer = get_scorer("roc_auc")
# somehow set the pos_label
scorer._kwargs["pos_label"] = "xxx"
scorer_2 = get_scorer("roc_auc")
# I would expect it to be a deep copy and not the ... | Working on sample props I also encountered this issue.
I have been thinking of `get_scorer` as returning a singleton and should not be modified. In general, I think returning a copy would be better because the following is undesirable:
```py
from sklearn.metrics import get_scorer
scorer = get_scorer("roc_auc")
... | [
{
"body": "I stumble in something that I am wondering if this is an issue:\r\n\r\n```python\r\nscorer = get_scorer(\"roc_auc\")\r\n# somehow set the pos_label\r\nscorer._kwargs[\"pos_label\"] = \"xxx\"\r\n\r\nscorer_2 = get_scorer(\"roc_auc\")\r\n# I would expect it to be a deep copy and not the same as scorer\... | 38ff5be25d0164bf9598bcfdde3b791ad6e261b0 | {
"head_commit": "19501e5dc1c80247306b0356ee7531e344eb3300",
"head_commit_message": "add whats_new",
"patch_to_review": "diff --git a/doc/modules/model_evaluation.rst b/doc/modules/model_evaluation.rst\nindex a1fce2d3454dc..3d6a9327229e9 100644\n--- a/doc/modules/model_evaluation.rst\n+++ b/doc/modules/model_eval... | [
{
"diff_hunk": "@@ -747,7 +757,20 @@ def make_scorer(\n fowlkes_mallows_scorer = make_scorer(fowlkes_mallows_score)\n \n \n-SCORERS = dict(\n+class _Scorers(dict):",
"line": null,
"original_line": 760,
"original_start_line": null,
"path": "sklearn/metrics/_scorer.py",
"start_line": null,
... | 68cc9ea5dba2d085e1466c70e4611184b59fbf1e | diff --git a/doc/modules/classes.rst b/doc/modules/classes.rst
index b7000bcf7cbb2..9fe76e2699f05 100644
--- a/doc/modules/classes.rst
+++ b/doc/modules/classes.rst
@@ -933,6 +933,7 @@ details.
metrics.check_scoring
metrics.get_scorer
+ metrics.get_scorer_names
metrics.make_scorer
Classification metr... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
scikit-learn__scikit-learn-23033@8861f4a | scikit-learn/scikit-learn | Python | 23,033 | FIX Raise error when n_neighbours >= n_samples / 2 in manifold.trustworthiness | #### Reference Issues/PRs
Resolves #18832 (stalled)
Fixes #18567
#### What does this implement/fix? Explain your changes.
PR #18832: Added warning to `manifold.trustworthiness` when `n_neighbors > n_features`.
This PR: Improved tests and wording and addressed reviewer comments.
#### Any other comments? | 2022-04-02T22:27:22Z | bug: sklearn.manifold.turstworthiness outputs values larger than 1
The trustworthiness computation might be erroneous as for some cases I can see that it is providing values that are larger than 1.
Here is a code snippet that produces value larger than 1 in my machine:
```
import numpy as np
from sklearn.manifo... | I get the same result when I run it. I wonder if the implementation of the algorithm is correct or not.
The way it's written in the code doesn't exactly match the description in the paper. Specifically, the code has a `max` function applied where the paper doesn't. But simply removing it didn't fix the problem (the ... | [
{
"body": "The trustworthiness computation might be erroneous as for some cases I can see that it is providing values that are larger than 1.\r\n\r\nHere is a code snippet that produces value larger than 1 in my machine:\r\n\r\n```\r\nimport numpy as np\r\nfrom sklearn.manifold import trustworthiness\r\n\r\n#im... | df692c03c1a6003878c6fc4d2f9f222d304dcee3 | {
"head_commit": "8861f4aa887f0278a0f484bea9c4c8a6df78c036",
"head_commit_message": "Added changelog entry",
"patch_to_review": "diff --git a/doc/whats_new/v1.1.rst b/doc/whats_new/v1.1.rst\nindex 6c03456bcaf0c..59de4efda428e 100644\n--- a/doc/whats_new/v1.1.rst\n+++ b/doc/whats_new/v1.1.rst\n@@ -284,7 +284,7 @@ ... | [
{
"diff_hunk": "@@ -491,7 +493,23 @@ def trustworthiness(X, X_embedded, *, n_neighbors=5, metric=\"euclidean\"):\n -------\n trustworthiness : float\n Trustworthiness of the low-dimensional embedding.\n+\n+ References\n+ ----------\n+ .. [1] Jarkko Venna and Samuel Kaski. 2001. Neighbor... | 5ba76552756cd63f4b33246deba999b2940f06bb | diff --git a/doc/whats_new/v1.1.rst b/doc/whats_new/v1.1.rst
index 4555c84a12619..efe43b68adc12 100644
--- a/doc/whats_new/v1.1.rst
+++ b/doc/whats_new/v1.1.rst
@@ -737,6 +737,11 @@ Changelog
:pr:`21805` by :user:`Jeanne Dionisi <jeannedionisi>` and :pr:`22685` by
:user:`Meekail Zain <micky774>`.
+- |Enhancemen... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
scikit-learn__scikit-learn-22891@ba1a5e4 | scikit-learn/scikit-learn | Python | 22,891 | FIX LinearRegression sparse + intercept + sample_weight | Partial fix for #15438
Fixes https://github.com/scikit-learn/scikit-learn/issues/19578
This PR fixes the issue for LinearRegression only. I intend to check other linear models in separate PR(s).
To account for sample weight, we rescale X and y. When X is sparse we also need to rescale X_offset because the center... | 2022-03-18T12:24:47Z | LinearRegression fits wrongly on csr sparse matrix with sample weights
<!--
Before submitting a bug, please make sure the issue hasn't been already
addressed by searching through the past issues.
-->
#### Describe the bug
Fitting a model from a csr sparse matrix while passing sample_weight gives a very wrong f... | OTOH, here is a simple example that does work:
```python
X = sp.sparse.csr_matrix(np.array([[1, 0]] * 100 + [[0, 1]] * 100))
y = np.array([1] * 80 + [0] * 20 + [1] * 50 + [0] * 50)
w = np.array([1] * 80 + [4] * 20 + [1] * 50 + [2] * 50)
LinearRegression(fit_intercept=False).fit(X, y, sample_weight=w).coef_
=>... | [
{
"body": "<!--\r\nBefore submitting a bug, please make sure the issue hasn't been already\r\naddressed by searching through the past issues.\r\n-->\r\n\r\n#### Describe the bug\r\n\r\nFitting a model from a csr sparse matrix while passing sample_weight gives a very wrong fit.\r\n\r\nThis report is for `LinearR... | aee564c544e3245e52bd413709e43f192ad02ba9 | {
"head_commit": "ba1a5e43f1781facc25c34eb00c95a005d73ee00",
"head_commit_message": "address comments",
"patch_to_review": "diff --git a/doc/whats_new/v1.1.rst b/doc/whats_new/v1.1.rst\nindex f64a6bda6ea95..7786870dc523f 100644\n--- a/doc/whats_new/v1.1.rst\n+++ b/doc/whats_new/v1.1.rst\n@@ -594,6 +594,10 @@ Chan... | [
{
"diff_hunk": "@@ -708,10 +711,10 @@ def fit(self, X, y, sample_weight=None):\n X_offset_scale = X_offset / X_scale\n \n def matvec(b):\n- return X.dot(b) - b.dot(X_offset_scale)\n+ return X.dot(b) - sample_weight * b.dot(X_offset_scale)\n \n de... | 49e2bcea28d3310701bebe1047b795345846cb45 | diff --git a/doc/whats_new/v1.1.rst b/doc/whats_new/v1.1.rst
index f64a6bda6ea95..7786870dc523f 100644
--- a/doc/whats_new/v1.1.rst
+++ b/doc/whats_new/v1.1.rst
@@ -594,6 +594,10 @@ Changelog
:class:`linear_model.ARDRegression` now preserve float32 dtype. :pr:`9087` by
:user:`Arthur Imbert <Henley13>` and :pr:`22... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Bug Fixes"
} |
scikit-learn__scikit-learn-25991@e8bdbc7 | scikit-learn/scikit-learn | Python | 25,991 | ENH FeatureUnion: Add verbose_feature_names_out parameter | <!--
Thanks for contributing a pull request! Please ensure you have taken a look at
the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md
-->
#### Reference Issues/PRs
Fixes #25889.
#### What does this implement/fix? Explain your changes.
To have a ```verbose_fe... | 2023-03-28T05:26:04Z | FeatureUnion: Add verbose_feature_names_out parameter
### Describe the workflow you want to enable
`ColumnTransformer` has the option to specify whether or not to "prefix all feature names with the name of the transformer that generated that feature" using the `verbose_feature_names_out` parameter.
`FeatureUnion` d... | I think it makes sense to have a `verbose_feature_names_out` in `FeatureUnion` that is similar to `ColumnTransformer`. The implementation should end up similar to ColumnTransformer:
https://github.com/scikit-learn/scikit-learn/blob/e3d1f9ac39e4bf0f31430e779acc50fb05fe1b64/sklearn/compose/_column_transformer.py#L492
... | [
{
"body": "### Describe the workflow you want to enable\n\n`ColumnTransformer` has the option to specify whether or not to \"prefix all feature names with the name of the transformer that generated that feature\" using the `verbose_feature_names_out` parameter.\r\n\r\n`FeatureUnion` does not have this option. A... | 29b14aea8b4d3ab9f63dd2b1f64ab0b10e6575ce | {
"head_commit": "e8bdbc7500212e90c7de733dc66541a3327539b5",
"head_commit_message": "Merge branch 'main' into my_feature",
"patch_to_review": "diff --git a/doc/whats_new/v1.3.rst b/doc/whats_new/v1.3.rst\nindex 07b581f2104b1..fa120f0d01dec 100644\n--- a/doc/whats_new/v1.3.rst\n+++ b/doc/whats_new/v1.3.rst\n@@ -37... | [
{
"diff_hunk": "@@ -1141,6 +1140,124 @@ def test_feature_union_passthrough_get_feature_names_out():\n )\n \n \n+def test_feature_union_passthrough_get_feature_names_out_false():\n+ \"\"\"Check feature_names_out for verbose_feature_names_out=False\"\"\"\n+ X = iris.data\n+ pca = PCA(n_components=2, ... | 4196d0870613244d05d7e7f6df6ffc9b82a7215c | diff --git a/doc/whats_new/v1.5.rst b/doc/whats_new/v1.5.rst
index c0c96f14ae612..f9ad75d1b5643 100644
--- a/doc/whats_new/v1.5.rst
+++ b/doc/whats_new/v1.5.rst
@@ -129,6 +129,16 @@ Changelog
- |Enhancement| :term:`CV splitters <CV splitter>` that ignores the group parameter now
raises a warning when groups are pas... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} |
scikit-learn__scikit-learn-22965@011ab6d | scikit-learn/scikit-learn | Python | 22,965 | ENH Add sparse input support to OPTICS | #### Reference Issues/PRs
Fixes #11982
Resolves #14736 (stalled)
Resolves #20802 (stalled)
#### What does this implement/fix? Explain your changes.
PRs #14736 and #20802: Add support for sparse matrices in `OPTICS.fit`
This PR: updates work and provides continuation for review.
#### Any other comments? | 2022-03-27T00:53:50Z | OPTICS should support sparse matrices and precomputed distances
OPTICS relies on the nearest neighbor graph, and should be possible to perform with precomputed distances (maybe it does already, but I don't think it's tested), and with sparse feature spaces. It should perhaps also be possible to perform with sparse prec... | I tried and it doesn't support `precomputed` as it is. But it shouldn't be hard to fix.
Hello, i want to deal with this issue.
Do you still need help?
I am beginner, is that a problem?
I will work really hard in order to make my first contribution. | [
{
"body": "OPTICS relies on the nearest neighbor graph, and should be possible to perform with precomputed distances (maybe it does already, but I don't think it's tested), and with sparse feature spaces. It should perhaps also be possible to perform with sparse precomputed neighborhoods (e.g. as returned from ... | 2e3abc2e32eefbfea78f15bcc767ca9bb4911568 | {
"head_commit": "011ab6d4cbb594d6ab3e4b02c18809c7863e3ef8",
"head_commit_message": "Updated changelog entry",
"patch_to_review": "diff --git a/doc/whats_new/v1.0.rst b/doc/whats_new/v1.0.rst\nindex 1418bcbdf37f0..7e859248952b6 100644\n--- a/doc/whats_new/v1.0.rst\n+++ b/doc/whats_new/v1.0.rst\n@@ -499,6 +499,12 ... | [
{
"diff_hunk": "@@ -499,6 +499,12 @@ Changelog\n - |API| :func:`cluster.spectral_clustering` raises an improved error when passed\n a `np.matrix`. :pr:`20560` by `Thomas Fan`_.\n \n+- |Enhancement| The `predict` and `fit_predict` methods of\n+ :class:`cluster.OPTICS` now accept sparse data type for input\n+ ... | c22d638b9e78c8e4332c8f7b2d806fa581f39fce | diff --git a/doc/whats_new/v1.2.rst b/doc/whats_new/v1.2.rst
index bdb9f3018aba8..e3c5d46bc8e2a 100644
--- a/doc/whats_new/v1.2.rst
+++ b/doc/whats_new/v1.2.rst
@@ -33,6 +33,14 @@ Changelog
:pr:`123456` by :user:`Joe Bloggs <joeongithub>`.
where 123456 is the *pull request* number, not the issue number.
+:m... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "New Feature Additions"
} |
scikit-learn__scikit-learn-22775@c4dcbf0 | scikit-learn/scikit-learn | Python | 22,775 | FIX Fix ColumnTransformer.get_feature_names_out with slices | <!--
Thanks for contributing a pull request! Please ensure you have taken a look at
the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md
-->
#### Reference Issues/PRs
Fixes #22774
<!--
Example: Fixes #1234. See also #3456.
Please use keywords (e.g., Fixes) to cre... | 2022-03-12T06:52:03Z | ColumnTransformer's get_feature_names_out does not work properly with slices
### Describe the bug
Slices are a supported for selecting columns in `ColumnTransformer`. Also, `get_column_names_out` is supported to label generated columns. But get_column_names_out does not work with slices.
### Steps/Code to Reprodu... | [
{
"body": "### Describe the bug\r\n\r\nSlices are a supported for selecting columns in `ColumnTransformer`. Also, `get_column_names_out` is supported to label generated columns. But get_column_names_out does not work with slices.\r\n\r\n### Steps/Code to Reproduce\r\n\r\n```python\r\nimport numpy as np\r\nimpor... | cd5385e7112c453afff205fa0ce6a67356cbcf32 | {
"head_commit": "c4dcbf05acbd45ddf7920d130975ddf967276efe",
"head_commit_message": "Added note in v1.1 whats_new and tests for new functionality",
"patch_to_review": "diff --git a/doc/whats_new/v1.1.rst b/doc/whats_new/v1.1.rst\nindex 5030ed8faa4a1..0d076a4e89d34 100644\n--- a/doc/whats_new/v1.1.rst\n+++ b/doc/w... | [
{
"diff_hunk": "@@ -1832,6 +1856,30 @@ def test_verbose_feature_names_out_true(transformers, remainder, expected_names)\n \"drop\",\n [],\n ),\n+ (\n+ [\n+ (\"bycol1\", TransWithNames(), slice(1, 2)),\n+ (\"bycol2\", \"drop\", [\"d\... | 365144b0cab3f57e60d275af0dfe02684734d8a0 | diff --git a/doc/whats_new/v1.1.rst b/doc/whats_new/v1.1.rst
index 5030ed8faa4a1..0d076a4e89d34 100644
--- a/doc/whats_new/v1.1.rst
+++ b/doc/whats_new/v1.1.rst
@@ -182,6 +182,11 @@ Changelog
`__init__` and `set_params` methods.
:pr:`22537` by :user:`iofall <iofall>` and :user:`Arisa Y. <arisayosh>`.
+- |Fix| :... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} | |
scikit-learn__scikit-learn-22684@2ce00ae | scikit-learn/scikit-learn | Python | 22,684 | DOC Standardizing the documentation for `alpha` in `Ridge` and `Lasso` | #### Reference Issues/PRs
Fixes #18692
Resolves #18781 (stalled)
#### What does this implement/fix? Explain your changes.
PR #18781: Makes documentation for `alpha` parameter consistent between `Ridge` and `Lasso` classes.
This PR: Addresses review comments, updates w.r.t `main`, completes formatting, minor word... | 2022-03-03T23:30:22Z | Standardizing the documentation for `alpha` in `Ridge` and `Lasso`
#### Describe the issue linked to the documentation
I'm helping to teach a machine learning course using sklearn. The documentation for `alpha` in `Ridge` is as follows:
>Regularization strength; must be a positive float. Regularization improv... | Agreed, the `alpha` definition in `Lasso` seems to be much more straightforward, however, the `alpha` definition in`Ridge` seems to be interesting for a kind of why the value of `alpha` defaults to `1.0`. I would suggest we make the `Lasso` definition in both places, and below that, at the bottom of the page, under `No... | [
{
"body": "#### Describe the issue linked to the documentation\r\n\r\n\r\nI'm helping to teach a machine learning course using sklearn. The documentation for `alpha` in `Ridge` is as follows:\r\n\r\n>Regularization strength; must be a positive float. Regularization improves the conditioning of the problem and... | 578e3eb532d8ab5396d5579ff06e46604818e750 | {
"head_commit": "2ce00ae8f77a5820b93e38984ac5562710f05a85",
"head_commit_message": "Update sklearn/linear_model/_coordinate_descent.py\n\nCo-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com>",
"patch_to_review": "diff --git a/sklearn/linear_model/_coordinate_descent.py b/sklear... | [
{
"diff_hunk": "@@ -1249,6 +1249,15 @@ class Lasso(ElasticNet):\n To avoid unnecessary memory duplication the X argument of the fit method\n should be directly passed as a Fortran-contiguous numpy array.\n \n+ Alpha must be a positive float for regularization strength.",
"line": null,
"origin... | adbdba0cba2b6bc60d93735df052fa884f44ccc6 | diff --git a/sklearn/linear_model/_coordinate_descent.py b/sklearn/linear_model/_coordinate_descent.py
index 1813963717f7d..5c1073da3fdb7 100644
--- a/sklearn/linear_model/_coordinate_descent.py
+++ b/sklearn/linear_model/_coordinate_descent.py
@@ -1141,11 +1141,13 @@ class Lasso(ElasticNet):
Parameters
-----... | {
"difficulty": "low",
"estimated_review_effort": 1,
"problem_domain": "Documentation Updates"
} |
scikit-learn__scikit-learn-22687@af8e616 | scikit-learn/scikit-learn | Python | 22,687 | FIX Fixes KNeighborsRegressor.predict with array-likes | #### Reference Issues/PRs
Fixes #22683
#### What does this implement/fix? Explain your changes.
Previously `KenighborsRegressor.predict` was documented to accept "array-likes" however when `weights` is given as a callable, `predict(X)` calls `X.shape[0]`. To make `predict` compatible with array-likes this PR chang... | 2022-03-04T04:57:25Z | KNeighborsRegressor with a callable weights stopped working with numpy 1.22.2
### Describe the bug
When you use a callable for the weights param you get:
AttributeError: 'list' object has no attribute 'shape'
`neigh = KNeighborsRegressor(n_neighbors=5, algorithm='brute', metric=euclidean_distance, weights=weight... | [
{
"body": "### Describe the bug\n\nWhen you use a callable for the weights param you get:\r\n\r\nAttributeError: 'list' object has no attribute 'shape'\r\n\r\n`neigh = KNeighborsRegressor(n_neighbors=5, algorithm='brute', metric=euclidean_distance, weights=weights_p2)`\n\n### Steps/Code to Reproduce\n\n```\r\ni... | 269bdb94898b9944b10de2db6b17fffe7b69a432 | {
"head_commit": "af8e616eb9dcb8d897087c872b4a0ac9bb8e236b",
"head_commit_message": "Added non-regression test and changelog entry",
"patch_to_review": "diff --git a/doc/whats_new/v1.1.rst b/doc/whats_new/v1.1.rst\nindex ee0f75b92c789..3b8ec6ff4a6c8 100644\n--- a/doc/whats_new/v1.1.rst\n+++ b/doc/whats_new/v1.1.r... | [
{
"diff_hunk": "@@ -233,7 +233,7 @@ def predict(self, X):\n if weights is None:\n y_pred = np.mean(_y[neigh_ind], axis=1)\n else:\n- y_pred = np.empty((X.shape[0], _y.shape[1]), dtype=np.float64)\n+ y_pred = np.empty((len(X), _y.shape[1]), dtype=np.float64)",
... | cd86b61f347e718ef2148a4178aa0e32feb5c1e8 | diff --git a/doc/whats_new/v1.1.rst b/doc/whats_new/v1.1.rst
index 584dd796b5789..00d77bfa33130 100644
--- a/doc/whats_new/v1.1.rst
+++ b/doc/whats_new/v1.1.rst
@@ -659,6 +659,11 @@ Changelog
instead of `__init__`. :pr:`21430` by :user:`Desislava Vasileva <DessyVV>` and
:user:`Lucy Jimenez <LucyJimenez>`.
+- |F... | {
"difficulty": "low",
"estimated_review_effort": 2,
"problem_domain": "Bug Fixes"
} | |
scikit-learn__scikit-learn-22685@83c975b | scikit-learn/scikit-learn | Python | 22,685 | ENH Adds `metric_params` parameter to pass to metrics in `TSNE` | #### Reference Issues/PRs
Fixes #11793
Resolves #21805 (stalled)
#### What does this implement/fix? Explain your changes.
PR #21805: Adds a new `metric_params` argument to the TSNE constructor. It defaults to `None`, and can be used to pass keyword args to the chosen metric.
This PR: Addresses remaining revie... | 2022-03-03T23:45:20Z | Error on method_parameters with TSNE from sklearn with mahalanobis metric
#### Description
With TSNE from sklearn v0.19.2 python 3.6 with mahalanobis metric I am getting following error
ValueError: Must provide either V or VI for Mahalanobis distance
How to provide an **method_parameters** for the Mahalanob... | Some workaround is suggested on SO:
https://stackoverflow.com/questions/51766963/tsne-from-sklearn-with-mahalanobis-metric/51767948#51767948
This error comes when TSNE `method` param is not `'exact'`. In this case, NearestNeighbors is used.
Even in that, this only arises when `algorithm` param is set as `'ball_tree'`... | [
{
"body": "\r\n#### Description\r\n\r\n\r\nWith TSNE from sklearn v0.19.2 python 3.6 with mahalanobis metric I am getting following error\r\nValueError: Must provide either V or VI for Mahalanobis distance\r\nHow to provide an **method_parameters** for the Mahalanobis distance?\r\n\r\n#### Steps/Code to Reprod... | 269bdb94898b9944b10de2db6b17fffe7b69a432 | {
"head_commit": "83c975b7a861200b5b06e1e8333054cac064330a",
"head_commit_message": "Adds PR number to changelog",
"patch_to_review": "diff --git a/doc/whats_new/v1.1.rst b/doc/whats_new/v1.1.rst\nindex ee0f75b92c789..e83afb03c3702 100644\n--- a/doc/whats_new/v1.1.rst\n+++ b/doc/whats_new/v1.1.rst\n@@ -566,6 +566... | [
{
"diff_hunk": "@@ -1198,6 +1198,38 @@ def test_tsne_n_jobs(method):\n assert_allclose(X_tr_ref, X_tr)\n \n \n+# TODO: Remove filterwarnings in 1.2\n+@pytest.mark.filterwarnings(\"ignore:.*TSNE will change.*:FutureWarning\")\n+def test_tsne_with_mahalanobis_distance():\n+ \"\"\"Make sure that method_para... | ac3643846a8c7ef86dd85e4653eb1e485e95a173 | diff --git a/doc/whats_new/v1.1.rst b/doc/whats_new/v1.1.rst
index 584dd796b5789..458ee684fcba9 100644
--- a/doc/whats_new/v1.1.rst
+++ b/doc/whats_new/v1.1.rst
@@ -569,6 +569,11 @@ Changelog
in eigen_solvers `lobpcg` and `amg` to improve their numerical stability.
:pr:`21565` by :user:`Andrew Knyazev <lobpcg>`.
... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
saltstack__salt-65117@65dbd88 | saltstack/salt | Python | 65,117 | [3006.x] Add instructions for how to run the package tests | ### What does this PR do?
See title
### What issues does this PR fix or reference?
Fixes: https://github.com/saltstack/salt/issues/64400
### Merge requirements satisfied?
**[NOTICE] Bug fixes or features added to Salt require tests.**
<!-- Please review the [test documentation](https://docs.saltproject.io/en/... | 2023-09-05T21:50:00Z | [DOCS] [Package Tests] Add instructions on how to run the package tests
**Description**
Currently, the package tests are a black box for the community. There are some prerequisites that are not documented well anywhere. We should document them and the process of running the package tests. | @barneysowood, based on your open hour question, I have added this docs issue and will get to it when I have the time. Likely, at the very least, after the completion of https://github.com/saltstack/salt/issues/64387
@MKLeb - this is great, thanks very much!
@MKLeb , feel free to add me as a reviewer on any PRs. | [
{
"body": "**Description**\r\nCurrently, the package tests are a black box for the community. There are some prerequisites that are not documented well anywhere. We should document them and the process of running the package tests.",
"number": 64400,
"title": "[DOCS] [Package Tests] Add instructions o... | 24bd2879ff2fb44d9c98e1e53c8e53976ca1cb94 | {
"head_commit": "65dbd880770008a5b8cd68d852f68637c8c3c486",
"head_commit_message": "Fix bulleted list indentation issues during man page generation",
"patch_to_review": "diff --git a/doc/topics/packaging/index.rst b/doc/topics/packaging/index.rst\nindex 58ac77b4f9fc..755bf73a54c5 100644\n--- a/doc/topics/packagi... | [
{
"diff_hunk": "@@ -0,0 +1,150 @@\n+.. _pkging-testing:\n+\n+================\n+Testing packages\n+================\n+\n+The package test suite\n+======================\n+\n+The salt repo provides a test suite for testing basic functionality of our\n+packages at ``<repo-root>/pkg/tests/``. You can run the insta... | e37fe8ce914fb53046b13447066a81f67cd21e76 | diff --git a/doc/topics/packaging/index.rst b/doc/topics/packaging/index.rst
index 58ac77b4f9fc..755bf73a54c5 100644
--- a/doc/topics/packaging/index.rst
+++ b/doc/topics/packaging/index.rst
@@ -190,3 +190,12 @@ How to access python binary
The python library is available in the install directory of the onedir packag... | {
"difficulty": "low",
"estimated_review_effort": 2,
"problem_domain": "Test Suite / CI Enhancements"
} |
saltstack__salt-64675@dd239d0 | saltstack/salt | Python | 64,675 | [master][FEATURE REQUEST] Added support for dnf5 for Fedora | ### What does this PR do?
Adds support for ```dnf5``` on Fedora.
```dnf5``` has changed options etc from the current versions of ```dnf```,
for example: ```--allowerasing``` is no longer a general option but tied to specific commands like ```install```.
```dnf5``` has changed other options too but has provided al... | 2023-07-20T00:30:21Z | [FEATURE REQUEST] salt-minion pkg.* tasks fail if only dnf5 is present, not dnf
**Description**
pkg.* uses dnf with no issues for me on Fedora. However, starting with Fedora 39, dnf is obsoleted by dnf5. The command line options are different, so a simple symlink won't work.
**Setup**
```
install_fedora_packages:... | Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey.
Please be sure to review our [Code... | [
{
"body": "**Description**\r\npkg.* uses dnf with no issues for me on Fedora. However, starting with Fedora 39, dnf is obsoleted by dnf5. The command line options are different, so a simple symlink won't work.\r\n\r\n**Setup**\r\n```\r\ninstall_fedora_packages:\r\n pkg.installed:\r\n - pkgs:\r\n - vim-... | 1ef90cbdc7203f97775edb7666db86a41eb9fc15 | {
"head_commit": "dd239d061003b7e9d9a0c22836204acd6df46320",
"head_commit_message": "Added changelog entry",
"patch_to_review": "diff --git a/changelog/64532.added.md b/changelog/64532.added.md\nnew file mode 100644\nindex 000000000000..53595d69280d\n--- /dev/null\n+++ b/changelog/64532.added.md\n@@ -0,0 +1 @@\n+... | [
{
"diff_hunk": "@@ -122,12 +124,12 @@ def _get_hold(line, pattern=__HOLD_PATTERN, full=True):\n dnf ==> vim-enhanced-2:7.4.827-1.fc22.*\n \"\"\"\n if full:\n- if _yum() == \"dnf\":\n+ if _yum() == \"dnf\" or _yum() == \"dnf5\":",
"line": null,
"original_line": 127,
"origina... | 9d4f211b01cada23c66d714d5e58662fa382a9da | diff --git a/changelog/64532.added.md b/changelog/64532.added.md
new file mode 100644
index 000000000000..53595d69280d
--- /dev/null
+++ b/changelog/64532.added.md
@@ -0,0 +1 @@
+Added support for dnf5 and its new command syntax
diff --git a/salt/modules/yumpkg.py b/salt/modules/yumpkg.py
index 413c0e12f77a..31129855fc... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "New Feature Additions"
} |
sqlfluff__sqlfluff-2923@6e3ba18 | sqlfluff/sqlfluff | Python | 2,923 | Pass dbt vars to dbt | Two small changes related to dbt plugin, both have been documented and tested, but I would be happy to take another look if something does not look right.
## Fixed issue #1262
fixes #1262
Allows sqlfluff to emulate dbt's cli calls with vars flag:
```
dbt run --vars 'variable_not_included_in_dbt_config: 1'
```... | 2022-03-25T18:56:05Z | Allow for DBT arguments in config
The current DBT config assumes no arguments are passed on ```dbt run```, but many instances where the dbt-profile is configured to uses variables when building, such as for the database name. This prevents sqlfluff from being able to build the targets. | Can you provide more detail about what arguments should be supported, and link to the dbt docs on those arguments? We can't start work on this until we have these details.
@barrywhart I was just about to raise a similar issue, so I'll add my comment here instead :)
I guess @kamcdonough20 meant DBT's [vars](https://d... | [
{
"body": "The current DBT config assumes no arguments are passed on ```dbt run```, but many instances where the dbt-profile is configured to uses variables when building, such as for the database name. This prevents sqlfluff from being able to build the targets.",
"number": 1262,
"title": "Allow for ... | 3d52e8270d82aeccf4c516d059a80a6947919aea | {
"head_commit": "6e3ba181612390a788d65f2aed3afe2af9d224e6",
"head_commit_message": "Updated Dev container config\n\n* fixed missing requirement to use buildkit\n* parametrized .dbt/profiles.yml to point to correct container\n automatically",
"patch_to_review": "diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md\nin... | [
{
"diff_hunk": "@@ -431,3 +431,27 @@ def test__project_dir_does_not_exist_error(dbt_templater, caplog): # noqa: F811\n ) in caplog.text\n finally:\n logger.propagate = original_propagate_value\n+\n+\n+@pytest.mark.parametrize(\n+ (\"model_path\", \"var_value\")\n+ , [\n+ (\"mod... | bc22b5f17f15362ea07abeaf315326cb37f213dc | diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 208b10984b9..8237356ca23 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -207,7 +207,6 @@ Steps to use the Docker Compose environment:
* Install Docker on your machine.
* Run `plugins/sqlfluff-templater-dbt/docker/startup` to create the containers.
* Run `pl... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} |
scikit-learn__scikit-learn-22722@a193cd3 | scikit-learn/scikit-learn | Python | 22,722 | MAINT Common parameter validation | This PR proposes a unified design for parameter validation across estimators, classes and functions.
The goal is to have a consistent way to raise an informative error message when a parameter does not have a valid type/value. Here's an example:
```py
>>> KMeans(init="wrong").fit(X)
ValueError: The 'init' paramet... | 2022-03-07T16:21:09Z | Use decorators for simple input validations
We have a lot of input validations on simple scalar inputs which can be handled with a decorator. It'd be less error prune and would simplify the code. Do we think that's a good idea?
Something like
```python
@validate_input('threshold', min=0, max=1, type=[float, int]... | I like this for functions.
We also do a bunch of similar validation in `fit` which we would not be able to use this decorator... unless we do something clever.
Yeah I was hoping we could do that for methods too, haven't looked into how it'd work though.
@thomasjpfan the [`wrapt`](https://github.com/GrahamDumpleton/... | [
{
"body": "We have a lot of input validations on simple scalar inputs which can be handled with a decorator. It'd be less error prune and would simplify the code. Do we think that's a good idea?\r\n\r\nSomething like\r\n\r\n```python\r\n@validate_input('threshold', min=0, max=1, type=[float, int],\r\n err_me... | 08275348cd2c186386d848bbe0099478049a4589 | {
"head_commit": "a193cd3cb6e7e74fb8c5bc47dc46ebbe2afaa859",
"head_commit_message": "address comments",
"patch_to_review": "diff --git a/sklearn/base.py b/sklearn/base.py\nindex 474380152028b..69c4ffad3dda2 100644\n--- a/sklearn/base.py\n+++ b/sklearn/base.py\n@@ -25,8 +25,9 @@\n from .utils.validation import _ch... | [
{
"diff_hunk": "@@ -0,0 +1,421 @@\n+from abc import ABC\n+from abc import abstractmethod\n+import functools\n+from inspect import signature\n+from numbers import Integral\n+from numbers import Real\n+import operator\n+\n+import numpy as np\n+from scipy.sparse import issparse\n+\n+from .validation import _is_arr... | 3b4700639d0e7272b368c1459886ad6601640f6a | diff --git a/sklearn/base.py b/sklearn/base.py
index 757fb0e23841a..cd88eb6d59f99 100644
--- a/sklearn/base.py
+++ b/sklearn/base.py
@@ -25,8 +25,9 @@
from .utils.validation import _check_feature_names_in
from .utils.validation import _generate_get_feature_names_out
from .utils.validation import check_is_fitted
-fro... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Code Refactoring / Architectural Improvement"
} |
scikit-learn__scikit-learn-22582@567f859 | scikit-learn/scikit-learn | Python | 22,582 | DOC/TST Clarify group order in GroupKFold and LeaveOneGroupOut | <!--
Thanks for contributing a pull request! Please ensure you have taken a look at
the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md
-->
#### Reference Issues/PRs
<!--
Example: Fixes #1234. See also #3456.
Please use keywords (e.g., Fixes) to create link to th... | 2022-02-22T22:15:10Z | Clarify group order in GroupKFold and LeaveOneGroupOut
#### Describe the bug
`GroupKFold` builds folds with non-overlapping groups in it. The order of the groups seems random and not sorted by group ID. A naiv user like me expects the groups to be ordered over the folds.
#### Steps/Code to Reproduce
```python
imp... | what cv objects should guarantee is that order does not change every time you call split. I am more wondering why you have no shuffle and random_state parameters in GroupKFold to match the KFold API.
unless the need you report is quite common I would write my own code / private function/object to do what you suggest... | [
{
"body": "#### Describe the bug\r\n`GroupKFold` builds folds with non-overlapping groups in it. The order of the groups seems random and not sorted by group ID. A naiv user like me expects the groups to be ordered over the folds.\r\n\r\n#### Steps/Code to Reproduce\r\n```python\r\nimport numpy as np\r\nfrom sk... | c2d0dcbce1c87b6ed374b22d2d8491b7a8442c83 | {
"head_commit": "567f8592f72e627303fa05dc485c08e0bfc7f3a9",
"head_commit_message": "Clarify group order in GroupKFold and LeaveOneGroupOut",
"patch_to_review": "diff --git a/sklearn/model_selection/_split.py b/sklearn/model_selection/_split.py\nindex e2939f6d96096..b1c438c8b91aa 100644\n--- a/sklearn/model_selec... | [
{
"diff_hunk": "@@ -1138,6 +1142,11 @@ class LeaveOneGroupOut(BaseCrossValidator):\n [3 4]] [[5 6]\n [7 8]] [1 2] [1 2]\n \n+ Notes",
"line": null,
"original_line": 1145,
"original_start_line": null,
"path": "sklearn/model_selection/_split.py",
"start_line": null,
"text": "@... | c99f9251c5d1bec7fe1d5ace3470ffcbade19f68 | diff --git a/sklearn/model_selection/_split.py b/sklearn/model_selection/_split.py
index e2939f6d96096..b072e4d56a9e5 100644
--- a/sklearn/model_selection/_split.py
+++ b/sklearn/model_selection/_split.py
@@ -469,6 +469,10 @@ class GroupKFold(_BaseKFold):
.. versionchanged:: 0.22
``n_splits`` defa... | {
"difficulty": "low",
"estimated_review_effort": 2,
"problem_domain": "Bug Fixes"
} |
saltstack__salt-65044@3249cb7 | saltstack/salt | Python | 65,044 | [master] Fix ipset new_set bug | ### What does this PR do?
Fixes a bug in ipset introduced in [0e46c149](https://github.com/saltstack/salt/commit/0e46c14907f1c63c9bd7206ed3a7dd59e59e0800#diff-f0cc809208d5a7ae3c8d9190536575ef7a8f5141d6785056ba2703991f971346L332-R332)
### What issues does this PR fix or reference?
Fixes: #61620, #62255, #63224
#... | 2023-08-24T13:08:36Z | [BUG] modules/ipset.py new_set Syntax error
**Description**
Running
`salt-call -l debug ipset.new_set name=whitelist set_type="hash:net" comment=True counters=True`
Gives error:
`[ERROR ] salt.loaded.int.module.cmdmod:1305 output: ipset v7.5: Syntax error: unknown inet family ['/usr/sbin/ipset', 'create', 'white... | +
The above (closed) PR resolved this issue for me. https://github.com/saltstack/salt/pull/61621 | [
{
"body": "**Description**\r\nRunning\r\n`salt-call -l debug ipset.new_set name=whitelist set_type=\"hash:net\" comment=True counters=True`\r\nGives error:\r\n`[ERROR ] salt.loaded.int.module.cmdmod:1305 output: ipset v7.5: Syntax error: unknown inet family ['/usr/sbin/ipset', 'create', 'whitelist', 'hash:ne... | 71218827449c6a2b24d650c8b06502009a928478 | {
"head_commit": "3249cb71b4eb9c05c425ad2235ae24c288b3218b",
"head_commit_message": "Fix ipset new_set bug",
"patch_to_review": "diff --git a/changelog/61620.fixed.md b/changelog/61620.fixed.md\nnew file mode 100644\nindex 000000000000..cd0818244ce9\n--- /dev/null\n+++ b/changelog/61620.fixed.md\n@@ -0,0 +1 @@\n+... | [
{
"diff_hunk": "@@ -47,3 +47,19 @@ def test_ipset_add_comment_kwarg(ipset, setup_set):\n assert ret == \"Success\"\n check_set = ipset.list_sets()\n assert any([x for x in check_set if x[\"Name\"] == setup_set])\n+\n+\n+def test_ipset_new_set_with_family(ipset):\n+ \"\"\"\n+ test ipset.new_set... | a2f1206352bde220109213cd1a907fc6a79f6816 | diff --git a/changelog/61620.fixed.md b/changelog/61620.fixed.md
new file mode 100644
index 000000000000..cd0818244ce9
--- /dev/null
+++ b/changelog/61620.fixed.md
@@ -0,0 +1 @@
+`ipset.new_set` no longer fails when creating a set type that uses the `family` create option
diff --git a/salt/modules/ipset.py b/salt/modul... | {
"difficulty": "low",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
scikit-learn__scikit-learn-23317@1da1d8a | scikit-learn/scikit-learn | Python | 23,317 | MNT: Make error message clearer for n_neighbors | <!--
Thanks for contributing a pull request! Please ensure you have taken a look at
the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md
-->
#### Reference Issues/PRs
#17207
<!--
Example: Fixes #1234. See also #3456.
Please use keywords (e.g., Fixes) to create li... | 2022-05-10T08:32:21Z | LocalOutlierFactor error when n_samples = 1 and n_neighbors = 1
Calling fit_predict() on LocalOutlierFactor with n_samples = n_neighbors = 1 results in the following ValueError :
Expected n_neighbors <= n_samples, but n_samples = 1, n_neighbors = 2
This error message is a bit confusing as n_neighbors was set to 1.... | This is a tricky one. Basically `n_neighbors` semantic here mean that you want to use the sample itself and its nearest neighbour which corresponds to `n_neighbors=2` if you are using `NearestNeighbors.kneighbors`. So in practice, the algorithm does exactly what you expect. The relevant lines of code are:
https://gi... | [
{
"body": "Calling fit_predict() on LocalOutlierFactor with n_samples = n_neighbors = 1 results in the following ValueError : \r\nExpected n_neighbors <= n_samples, but n_samples = 1, n_neighbors = 2\r\n\r\nThis error message is a bit confusing as n_neighbors was set to 1. It seems it is set to 2 by LocalOutlie... | 9e8f10ebff5ae5b30dde722a45d65dfb78b43c31 | {
"head_commit": "1da1d8a2bfa14590a6c49dcb186d7127045946a3",
"head_commit_message": "Add review suggestions to avoid repetition (@thomasjpfan)\n\nCo-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>",
"patch_to_review": "diff --git a/sklearn/neighbors/_base.py b/sklearn/neighbors/_base.py\nindex 10e99a34e6497..3... | [
{
"diff_hunk": "@@ -746,9 +747,15 @@ class from an array representing our data set and ask who's\n \n n_samples_fit = self.n_samples_fit_\n if n_neighbors > n_samples_fit:\n+ if query_is_train:\n+ n_neighbors -= 1\n+ inequality_str = \"n_neighbors < n_sam... | e51c52d20d08ebbf922148a099c910203b2713cf | diff --git a/doc/whats_new/v1.4.rst b/doc/whats_new/v1.4.rst
index ce16556feb88c..507b22cdf510a 100644
--- a/doc/whats_new/v1.4.rst
+++ b/doc/whats_new/v1.4.rst
@@ -474,6 +474,10 @@ Changelog
when `radius` is large and `algorithm="brute"` with non-Euclidean metrics.
:pr:`26828` by :user:`Omar Salman <OmarManzoor>... | {
"difficulty": "low",
"estimated_review_effort": 2,
"problem_domain": "Bug Fixes"
} |
scikit-learn__scikit-learn-22223@7d1a0fd | scikit-learn/scikit-learn | Python | 22,223 | ENH Fix AttributeError of compound kernel of Gaussian processes | <!--
Thanks for contributing a pull request! Please ensure you have taken a look at
the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md
-->
#### Reference Issues/PRs
<!--
Example: Fixes #1234. See also #3456.
Please use keywords (e.g., Fixes) to create link to th... | 2022-01-15T15:08:09Z | AttributeError of compound kernel of Gaussian processes
### Describe the bug
I am trying to use GaussianProcess classifier or regressor using the compound kernel (comprised of RBF and white kernels). Fit method of Gaussian process generates an error regarding its kernel, declaring that 'CompoundKernel' object has n... | I think that this is expected. `CompoundKernel` is used internally for classification: we will train a kernel per class in the multiclass setting and we store them in a `CompoundKernel`.
In regression, you don't have such behaviour: you have a single kernel and a single estimator.
I think what you try to do is to c... | [
{
"body": "### Describe the bug\r\n\r\nI am trying to use GaussianProcess classifier or regressor using the compound kernel (comprised of RBF and white kernels). Fit method of Gaussian process generates an error regarding its kernel, declaring that 'CompoundKernel' object has no attribute 'k1'. I regenerated th... | 1d1aadd0711b87d2a11c80aad15df6f8cf156712 | {
"head_commit": "7d1a0fd5b4b45b157cc70c886766b7d587fca4f7",
"head_commit_message": "removed spacebar in docs",
"patch_to_review": "diff --git a/doc/whats_new/v1.1.rst b/doc/whats_new/v1.1.rst\nindex eef1135855560..4e26134bec38a 100644\n--- a/doc/whats_new/v1.1.rst\n+++ b/doc/whats_new/v1.1.rst\n@@ -273,6 +273,13... | [
{
"diff_hunk": "@@ -260,3 +265,20 @@ def test_warning_bounds():\n \"Increasing the bound and calling \"\n \"fit again may find a better value.\"\n )\n+\n+\n+@pytest.mark.parametrize(\n+ \"params, TypeError, err_msg\",",
"line": null,
"original_line": 271,
"original_start_line"... | 3f8e77474152cb74cf1bfccb33acafb3979899be | diff --git a/doc/whats_new/v1.1.rst b/doc/whats_new/v1.1.rst
index eef1135855560..5c338d614b49d 100644
--- a/doc/whats_new/v1.1.rst
+++ b/doc/whats_new/v1.1.rst
@@ -273,6 +273,13 @@ Changelog
F-statistic).
:pr:`17819` by :user:`Juan Carlos Alfaro Jiménez <alfaro96>`.
+:mod:`sklearn.gaussian_process`
+............. | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
saltstack__salt-64518@54986af | saltstack/salt | Python | 64,518 | [master] Add syncing of custom ssh wrappers | ### What does this PR do?
Adds `sync_wrapper` to the `saltutil` runner/execution/state modules.
From what I can tell, the loader is already configured to load them.
### What issues does this PR fix or reference?
Fixes: https://github.com/saltstack/salt/issues/45450
Reference: https://github.com/saltstack/salt/is... | 2023-06-21T19:23:55Z | Allow custom modules which run on master
### Description of Issue/Question
### Setup
I am using `salt-ssh` to deploy configuration to servers. On my computer (SSH master) I have in `states` directory also `_modules` with some simple Python functions I want to run to process values in Jinja templates. I do somethi... | The only way you could render it on the master is if you put all that information into pillar data, and even if you did that, it would still need to be rendered once per minion. The states are not rendered at all on the master, we tar up the state tree into a `salt_states.tgz` on the salt master, then just send the ta... | [
{
"body": "### Description of Issue/Question\r\n\r\n### Setup\r\n\r\nI am using `salt-ssh` to deploy configuration to servers. On my computer (SSH master) I have in `states` directory also `_modules` with some simple Python functions I want to run to process values in Jinja templates. I do something like:\r\n\r... | b0bf7eba9b6c98153fb328ac823be421c92f524d | {
"head_commit": "54986afac177e73fb880cd2dcad28390ac2e1380",
"head_commit_message": "run pre-commit upgrade code for Py3.8+ again",
"patch_to_review": "diff --git a/changelog/45450.added.md b/changelog/45450.added.md\nnew file mode 100644\nindex 000000000000..c7d6cd93074b\n--- /dev/null\n+++ b/changelog/45450.add... | [
{
"diff_hunk": "@@ -835,3 +840,34 @@ def sync_executors(saltenv=\"base\", extmod_whitelist=None, extmod_blacklist=None)\n extmod_whitelist=extmod_whitelist,\n extmod_blacklist=extmod_blacklist,\n )[0]\n+\n+\n+def sync_wrapper(saltenv=\"base\", extmod_whitelist=None, extmod_blacklist=None):\n... | 4ffd6d5bcd72f0ae8cc781049e2bf2c22dce8d4d | diff --git a/changelog/45450.added.md b/changelog/45450.added.md
new file mode 100644
index 000000000000..c7d6cd93074b
--- /dev/null
+++ b/changelog/45450.added.md
@@ -0,0 +1 @@
+Added syncing of custom salt-ssh wrappers
diff --git a/doc/topics/development/modules/index.rst b/doc/topics/development/modules/index.rst
in... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} |
scikit-learn__scikit-learn-22181@657cf02 | scikit-learn/scikit-learn | Python | 22,181 | ENH Allow n_components = n_features in TruncatedSVD | <!--
Thanks for contributing a pull request! Please ensure you have taken a look at
the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md
-->
#### Reference Issues/PRs
<!--
Example: Fixes #1234. See also #3456.
Please use keywords (e.g., Fixes) to create link to th... | 2022-01-10T20:20:24Z | Allow `n_components == min(n_samples, n_features)` in TruncatedSVD
### Describe the workflow you want to enable
`sklearn.decomposition.PCA` allows me to use `svd_solver = 'randomized'` with `n_components == min(n_samples, n_features)` (in fact, this is the *default*!)
However, if I use `sklearn.decomposition.Trun... | I do not see any issue with supporting `n_components=min(n_samples, n_features)` with `algorithm="randomized"`. At a glance, we would need to remove the following and update tests/docs:
https://github.com/scikit-learn/scikit-learn/blob/26e2c38a961a27a9e53ce7814bf27f840510b237/sklearn/decomposition/_truncated_svd.py#... | [
{
"body": "### Describe the workflow you want to enable\r\n\r\n`sklearn.decomposition.PCA` allows me to use `svd_solver = 'randomized'` with `n_components == min(n_samples, n_features)` (in fact, this is the *default*!)\r\n\r\nHowever, if I use `sklearn.decomposition.TruncatedSVD` with the same data and `algori... | 5d7dc4ba327c138cf63be5cd9238200037c1eb13 | {
"head_commit": "657cf02d4bf8e1daedc51a7739dbd469110c4d69",
"head_commit_message": "update tests and docs",
"patch_to_review": "diff --git a/sklearn/decomposition/_truncated_svd.py b/sklearn/decomposition/_truncated_svd.py\nindex 01d79f742302f..1dcd695bb8e2b 100644\n--- a/sklearn/decomposition/_truncated_svd.py\... | [
{
"diff_hunk": "@@ -203,9 +204,9 @@ def fit_transform(self, X, y=None):\n elif self.algorithm == \"randomized\":\n k = self.n_components\n n_features = X.shape[1]\n- if k >= n_features:\n+ if k > n_features:\n raise ValueError(\n- ... | b3d76da52bda926dc0912cbab39ce1b00f8c1c6e | diff --git a/doc/whats_new/v1.1.rst b/doc/whats_new/v1.1.rst
index 61d5c64255f71..eb303997f577b 100644
--- a/doc/whats_new/v1.1.rst
+++ b/doc/whats_new/v1.1.rst
@@ -177,6 +177,10 @@ Changelog
preserve dtype for `numpy.float32`.
:pr:`22111` by :user:`Takeshi Oura <takoika>`.
+- |Enhancement| :class:`decompositio... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} |
scikit-learn__scikit-learn-22356@b56d90d | scikit-learn/scikit-learn | Python | 22,356 | ENH Allow `SelectFromModel`'s `max_features` to accept callables | #### Reference Issues/PRs
Fixes #21117
#### What does this implement/fix? Explain your changes.
This PR improves `SelectFromModel`'s `max_features` by allowing it to:
- Accept integral values to preserve prior behaviour
- Accept real values to prescribe a _proportion_ of features to allow
- Accepts a callable t... | 2022-02-01T20:16:29Z | SelectFromModel: max_features can't be greater than number of features
### Describe the bug
When I define a `SelectFromModel` instance like here:
```python
SelectFromModel(RandomForestClassifier(), max_features=100)
```
and the number of total features is less than 100, then a `ValueError` is raised:
```p... | I don't think this is a bug. the idea is that the developer knows exactly how many features come out of `SelectFromModel`. If you want, you can write your own `SelectMaxFeaturesFromModel` meta-estimator, which wraps around `SelectFromModel`, and selects max those number of features.
I agree with @kienerj that the curre... | [
{
"body": "### Describe the bug\r\n\r\nWhen I define a `SelectFromModel` instance like here:\r\n\r\n```python\r\nSelectFromModel(RandomForestClassifier(), max_features=100)\r\n```\r\n\r\nand the number of total features is less than 100, then a `ValueError` is raised:\r\n\r\n```pytb\r\nValueError: 'max_features... | 7dc97a378ecbfa056dd9cfa9d1ef4c07d2d0cc1f | {
"head_commit": "b56d90d58abb88a40367e79901a793b601cad6c7",
"head_commit_message": "Added a sample callable in `max_features` description",
"patch_to_review": "diff --git a/doc/whats_new/v1.1.rst b/doc/whats_new/v1.1.rst\nindex 4c307d9e54250..c71cf9b545e24 100644\n--- a/doc/whats_new/v1.1.rst\n+++ b/doc/whats_ne... | [
{
"diff_hunk": "@@ -247,18 +262,32 @@ def fit(self, X, y=None, **fit_params):\n Fitted estimator.\n \"\"\"\n if self.max_features is not None:\n- if not isinstance(self.max_features, numbers.Integral):\n- raise TypeError(\n- \"'max_feature... | 971ed724a19262b48c5b938c9e6a14757f8092c3 | diff --git a/doc/whats_new/v1.1.rst b/doc/whats_new/v1.1.rst
index a31b40cfff813..db126509e74ae 100644
--- a/doc/whats_new/v1.1.rst
+++ b/doc/whats_new/v1.1.rst
@@ -391,6 +391,13 @@ Changelog
- |Efficiency| Improve runtime performance of :func:`feature_selection.chi2`
with boolean arrays. :pr:`22235` by `Thomas Fan... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
saltstack__salt-64212@50ef393 | saltstack/salt | Python | 64,212 | [3006.x] `salt-pip` related fixes | ### What does this PR do?
* Add a `.pth` to the onedir env to ensure packages in extras are importable.
* Upgrade relenv
### What issues does this PR fix or reference?
Fixes: #64192 | 2023-05-02T21:10:29Z | [BUG] Salt Extensions Installed to Extras Location Are Not Accessible
**Description**
Beginning in 3006.0, any Salt extensions that are installed via PIP that are installed to the onedir extras directory are not accessible by Salt
**Steps to Reproduce the behavior**
Install a Salt extension via PIP that will be in... | This is also impacting any libraries installed to the extras directory. For example if using `salt-pip` to install heist-salt:
```
(heist-3.8) ch3ll@megan-precision5550 ~/onedir ./salt/extras-3.10/bin/heist --version
./salt/extras-3.10/bin/heist: line 3: /home/ch3ll/onedir/salt/extras-3.10/bin/python3: No suc... | [
{
"body": "**Description**\r\nBeginning in 3006.0, any Salt extensions that are installed via PIP that are installed to the onedir extras directory are not accessible by Salt\r\n\r\n**Steps to Reproduce the behavior**\r\nInstall a Salt extension via PIP that will be installed to the onedir extras directory\r\n\... | 42d3eaa6e6ae94189f9eb222503c6a660a032461 | {
"head_commit": "50ef393bca71f13e8aa8b549ad291e695dcbbfaf",
"head_commit_message": "Be sure to run the installed script to confirm it works\n\nSigned-off-by: Pedro Algarvio <palgarvio@vmware.com>",
"patch_to_review": "diff --git a/changelog/64192.fixed.md b/changelog/64192.fixed.md\nnew file mode 100644\nindex 0... | [
{
"diff_hunk": "@@ -22,7 +22,7 @@ inputs:\n required: false\n type: string\n description: The version of relenv to use\n- default: 0.10.2\n+ default: 0.12.0",
"line": null,
"original_line": 25,
"original_start_line": null,
"path": ".github/actions/setup-relenv/action.yml",
... | 070b4d0de0a8bb38e4e53b0cec666d1214b5ee58 | diff --git a/.github/actions/setup-relenv/action.yml b/.github/actions/setup-relenv/action.yml
index 745eb2939326..1f228fd1822f 100644
--- a/.github/actions/setup-relenv/action.yml
+++ b/.github/actions/setup-relenv/action.yml
@@ -22,7 +22,7 @@ inputs:
required: false
type: string
description: The versio... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
saltstack__salt-64599@0fbfdc8 | saltstack/salt | Python | 64,599 | [master] Prevent possible KeyError exception on calling salt.utils.user.get_group_dict | ### What does this PR do?
### What issues does this PR fix or reference?
Fixes: https://github.com/saltstack/salt/issues/62377 (the fix was merged already) with https://github.com/saltstack/salt/pull/62378, but this change is addressing specific corner case when the user has imporper duplicate of the group.
Step... | 2023-07-05T14:32:00Z | [BUG] groups with duplicate GIDs are not returned by get_group_list
**Description**
The following error is thrown when attempting to enforce optional group membership for a group which does not have a unique GID.
```
[ERROR ] These values could not be changed: {'groups': ['adm', 'audio', 'cdrom', 'dialout', 'd... | [
{
"body": "**Description**\r\n\r\nThe following error is thrown when attempting to enforce optional group membership for a group which does not have a unique GID.\r\n\r\n```\r\n[ERROR ] These values could not be changed: {'groups': ['adm', 'audio', 'cdrom', 'dialout', 'dip', 'floppy', 'netdev', 'plugdev', 'su... | 9a4da7d2e3e07e675c9d6bfc410a058f83141982 | {
"head_commit": "0fbfdc8e606eb27c7888d4363b39403553b0e38e",
"head_commit_message": "Add test of calling salt.utils.user.get_group_dict\n\nfor the user having improper duplicate group",
"patch_to_review": "diff --git a/salt/utils/user.py b/salt/utils/user.py\nindex 97636674430a..2f1ca65cf99a 100644\n--- a/salt/ut... | [
{
"diff_hunk": "@@ -0,0 +1,24 @@\n+import logging\n+\n+import pytest\n+\n+import salt.utils.platform\n+import salt.utils.user\n+from tests.support.mock import patch\n+\n+log = logging.getLogger(__name__)\n+\n+pytestmark = [\n+ pytest.mark.skip_on_windows,\n+]\n+\n+\n+@pytest.mark.skip_on_platforms(\n+ dar... | 77fdcf2b0a194a6d606c9af633965efa3798df3c | diff --git a/changelog/64599.fixed.md b/changelog/64599.fixed.md
new file mode 100644
index 000000000000..0d03c6b0cf79
--- /dev/null
+++ b/changelog/64599.fixed.md
@@ -0,0 +1,2 @@
+Fix possible `KeyError` exceptions in `salt.utils.user.get_group_dict`
+while reading improper duplicated GID assigned for the user.
diff -... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} | |
scikit-learn__scikit-learn-22154@51ee9f5 | scikit-learn/scikit-learn | Python | 22,154 | FIX Supports numpy strings and array-like in KMean.init | <!--
Thanks for contributing a pull request! Please ensure you have taken a look at
the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md
-->
#### Reference Issues/PRs
<!--
Example: Fixes #1234. See also #3456.
Please use keywords (e.g., Fixes) to create link to th... | 2022-01-09T00:54:44Z | Improper behavior when dealing with numpy.str_
### Describe the bug
For the argument in an algorithm that could accept both a string or a numpy.ndarray. It seems like if you pass the numpy.str_ as the argument type for a string input, it will parse it as a numpy.ndarray, as a result, a ValueError will be raised. I won... | `init_methods[0]` is a `numpy.str_` and surprisingly (to me at least) `hasattr(init_methods[0], "__array__")` gives `True`. Thus, the code assumes an input type differently.
I suggest using `KMeans(init = str(init_method)).fit(X)`
Yes, I'm also surprised when I find out this situation, I guess that numpy may jus... | [
{
"body": "### Describe the bug\n\nFor the argument in an algorithm that could accept both a string or a numpy.ndarray. It seems like if you pass the numpy.str_ as the argument type for a string input, it will parse it as a numpy.ndarray, as a result, a ValueError will be raised. I wonder if it is the behavior ... | 392151b63491d60daabc4a8fa9b43a71b8df811d | {
"head_commit": "51ee9f58ef82d3de183d0d724a83158003035fa7",
"head_commit_message": "DOC Adds whats new nubmer",
"patch_to_review": "diff --git a/doc/whats_new/v1.1.rst b/doc/whats_new/v1.1.rst\nindex 61d5c64255f71..ebbb17ab4da29 100644\n--- a/doc/whats_new/v1.1.rst\n+++ b/doc/whats_new/v1.1.rst\n@@ -95,6 +95,9 @... | [
{
"diff_hunk": "@@ -254,6 +255,11 @@ def _tolerance(X, tol):\n return np.mean(variances) * tol\n \n \n+def _is_arraylike_not_scalar(array):\n+ \"\"\"Return True if array is array-like and not a scalar\"\"\"\n+ return _is_arraylike(array) and not np.isscalar(array)",
"line": null,
"original_lin... | 55798b96b36bcd405f416ef53c6f474ffd2b63d6 | diff --git a/doc/whats_new/v1.1.rst b/doc/whats_new/v1.1.rst
index 5fd88b4132c3a..3c63e179ca28a 100644
--- a/doc/whats_new/v1.1.rst
+++ b/doc/whats_new/v1.1.rst
@@ -95,6 +95,9 @@ Changelog
See :func:`cluster.spectral_clustering` for more details.
:pr:`21148` by :user:`Andrew Knyazev <lobpcg>`
+- |Fix| :class:`c... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
saltstack__salt-64201@1b9bd74 | saltstack/salt | Python | 64,201 | [3006.x] Fix state for User policy | ### What does this PR do?
Fixes `lgpo_reg` state to work with User policy
### What issues does this PR fix or reference?
Fixes: #64200
### Merge requirements satisfied?
**[NOTICE] Bug fixes or features added to Salt require tests.**
<!-- Please review the [test documentation](https://docs.saltproject.io/en/m... | 2023-05-01T20:58:32Z | [BUG] lgpo_reg state doesn't work with User policy
**Description**
The lgpo_reg state doesn't work when specifying the User policy class
**Setup**
Given the following state (mystate.sls):
```
set_reg_pol_value:
lgpo_reg.value_present:
- key: SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced
... | [
{
"body": "**Description**\r\nThe lgpo_reg state doesn't work when specifying the User policy class\r\n\r\n**Setup**\r\nGiven the following state (mystate.sls):\r\n```\r\nset_reg_pol_value:\r\n lgpo_reg.value_present:\r\n - key: SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\r\n - name:... | 8f52a3c1f75cc29750f2fd579155ee634898b32f | {
"head_commit": "1b9bd74603636cbe0cff53ebd38b0e065dc0454d",
"head_commit_message": "Fix pre-commit",
"patch_to_review": "diff --git a/changelog/64200.fixed.md b/changelog/64200.fixed.md\nnew file mode 100644\nindex 000000000000..9c977309cb97\n--- /dev/null\n+++ b/changelog/64200.fixed.md\n@@ -0,0 +1 @@\n+Fix ``l... | [
{
"diff_hunk": "@@ -47,7 +47,24 @@ def empty_reg_pol():\n \n \n @pytest.fixture\n-def reg_pol():\n+def empty_reg_pol_user():\n+ class_info = salt.utils.win_lgpo_reg.CLASS_INFO\n+ reg_pol_file = pathlib.Path(class_info[\"User\"][\"policy_path\"])\n+ if not reg_pol_file.parent.exists():\n+ reg_pol... | aeff7e1385cddb5427b16302318929684768406a | diff --git a/changelog/64200.fixed.md b/changelog/64200.fixed.md
new file mode 100644
index 000000000000..9c977309cb97
--- /dev/null
+++ b/changelog/64200.fixed.md
@@ -0,0 +1 @@
+Fix ``lgpo_reg`` state to work with User policy
diff --git a/salt/modules/win_lgpo_reg.py b/salt/modules/win_lgpo_reg.py
index 4052de62bd3d..... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} | |
saltstack__salt-64182@2f3af0c | saltstack/salt | Python | 64,182 | [3006.x] deltaproxy, scheduler and event bus fixes | ### What does this PR do?
Update all the scheduler functions to include a fire_event argument which will determine whether to fire the completion event onto the event bus. This event is only used when these functions are called via the schedule execution modules. Inside deltaproxy, then update all scheudle related f... | 2023-04-27T18:24:29Z | [BUG] One network device failure caused the restart proxy in loop until manually stopped.
**Description**
One network device failure caused the restart proxy in loop until manually stopped.
**Setup**
Delta proxy devices loading from MongoDB script. There are 35 devices in one delta proxy and it keep crashing and ... | @vanditpatel619 This is related to the bug related to using multiple threads when the number of devices configured for a control proxy is greater than 20, this causes an error to occur and the process will restart. If you can divide up your minions so that each control proxy has no more than 20 sub proxies, that shoul... | [
{
"body": "**Description**\r\nOne network device failure caused the restart proxy in loop until manually stopped. \r\n\r\n**Setup**\r\nDelta proxy devices loading from MongoDB script. There are 35 devices in one delta proxy and it keep crashing and unable to start.\r\n\r\nPlease be as specific as possible and g... | 54be72064db1b1a9d40c6a8c2d550c32e2a14aef | {
"head_commit": "2f3af0cde6058b96e568d0c94f0ca92f38f1d653",
"head_commit_message": "Adding one more sub proxy.",
"patch_to_review": "diff --git a/changelog/64102.fixed.md b/changelog/64102.fixed.md\nnew file mode 100644\nindex 000000000000..64988c2f2e01\n--- /dev/null\n+++ b/changelog/64102.fixed.md\n@@ -0,0 +1,... | [
{
"diff_hunk": "@@ -0,0 +1,4 @@\n+Update all the scheduler functions to include a fire_event argument which will determine whether to fire the completion event onto the event bus.\n+This event is only used when these functions are called via the schedule execution modules.\n+Inside deltaproxy, then update all s... | 849446f84696c1defdf897f934dd3ea429710839 | diff --git a/changelog/64102.fixed.md b/changelog/64102.fixed.md
new file mode 100644
index 000000000000..09d14ab16cb5
--- /dev/null
+++ b/changelog/64102.fixed.md
@@ -0,0 +1,3 @@
+Update all the scheduler functions to include a fire_event argument which will determine whether to fire the completion event onto the even... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Bug Fixes"
} |
saltstack__salt-63938@7c1aa93 | saltstack/salt | Python | 63,938 | Auto reauth test | ### What does this PR do?
See title
### What issues does this PR fix or reference?
Fixes: https://github.com/saltstack/salt/issues/61109
### Merge requirements satisfied?
**[NOTICE] Bug fixes or features added to Salt require tests.**
<!-- Please review the [test documentation](https://docs.saltproject.io/en/... | 2023-03-23T19:50:20Z | [TECH DEBT] Add windows re-auth test to test suite.
Add windows re-auth test the test suite.
Make sure Linux master and Windows minion are connected and talking to each other.
Stop the Linux master and start the windows minion in debug mode:
It should just continue to restart the minion and attempt to re-authent... | [
{
"body": "Add windows re-auth test the test suite.\r\n\r\nMake sure Linux master and Windows minion are connected and talking to each other.\r\n\r\nStop the Linux master and start the windows minion in debug mode:\r\nIt should just continue to restart the minion and attempt to re-authenticate. The process shou... | 18b99263cd5e635993a5e35ee9f4f7ebb229e1ce | {
"head_commit": "7c1aa93e4d93a04a5fa383c000a9d65ac9c18ba4",
"head_commit_message": "Add reauth test",
"patch_to_review": "diff --git a/tests/pytests/scenarios/reauth/__init__.py b/tests/pytests/scenarios/reauth/__init__.py\nnew file mode 100644\nindex 000000000000..e69de29bb2d1\ndiff --git a/tests/pytests/scenar... | [
{
"diff_hunk": "@@ -0,0 +1,50 @@\n+import logging\n+import os\n+import threading\n+import time\n+\n+import pytest\n+\n+pytestmark = [\n+ pytest.mark.slow_test,\n+ pytest.mark.windows_whitelisted,\n+]\n+\n+log = logging.getLogger(__name__)\n+\n+\n+@pytest.fixture(scope=\"module\")\n+def timeout():\n+ re... | e04a1b84505a1ac9c88e7d1231150bb74a49c8cb | diff --git a/tests/pytests/scenarios/reauth/__init__.py b/tests/pytests/scenarios/reauth/__init__.py
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/tests/pytests/scenarios/reauth/conftest.py b/tests/pytests/scenarios/reauth/conftest.py
new file mode 100644
index 000000000000..bbefa71e1818
--- /dev/n... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Test Suite / CI Enhancements"
} | |
sqlfluff__sqlfluff-2735@e0c99a6 | sqlfluff/sqlfluff | Python | 2,735 | L007 autofix | L007 hasn't been a fixable Rule. This PR fixes that! :)
Fixes #1432
### Are there any other side effects of this change that we should be aware of?
No side-effects
### Pull Request checklist
- [x] Please confirm you have completed any of the necessary steps below.
- Included test cases to demonstrate any ... | 2022-02-28T10:28:39Z | Rule L007 should be autofixable
Rule L007 checks for operators before or after newlines.
That is:
```sql
SELECT
a
+ b
FROM foo
```
is preferred over
```sql
SELECT
a +
b
FROM foo
```
(or vice versa) depending on config.
As we can detect this pretty reliably, it seems it should... | [
{
"body": "Rule L007 checks for operators before or after newlines.\r\n\r\nThat is:\r\n\r\n```sql\r\nSELECT\r\n a\r\n + b\r\nFROM foo\r\n```\r\n\r\nis preferred over\r\n\r\n```sql\r\nSELECT\r\n a +\r\n b\r\nFROM foo\r\n```\r\n\r\n(or vice versa) depending on config.\r\n\r\nAs we can detect this pret... | 319bea6890e9a31bf9ea6ce5b75127197ad263f9 | {
"head_commit": "e0c99a661c7c95b578e9e256de7137a34d291c0a",
"head_commit_message": "remove newlines that imply new test but arent",
"patch_to_review": "diff --git a/src/sqlfluff/rules/L007.py b/src/sqlfluff/rules/L007.py\nindex 1b3f89e4558..50337d55409 100644\n--- a/src/sqlfluff/rules/L007.py\n+++ b/src/sqlfluff... | [
{
"diff_hunk": "@@ -60,49 +67,149 @@ def _eval(self, context: RuleContext) -> LintResult:\n \"\"\"\n anchor = None\n memory = context.memory\n+ parent_stack = context.parent_stack\n+ fixes: List[LintFix] = []\n+ # bring var to this scope so as to only have one type i... | 2fed45ef51cad173835ffd1ec3dc34411bf0cd04 | diff --git a/src/sqlfluff/core/rules/functional/segments.py b/src/sqlfluff/core/rules/functional/segments.py
index 6f19f3ff8ed..11c47b97b28 100644
--- a/src/sqlfluff/core/rules/functional/segments.py
+++ b/src/sqlfluff/core/rules/functional/segments.py
@@ -1,5 +1,5 @@
"""Surrogate class for working with Segment collec... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "New Feature Additions"
} | |
scikit-learn__scikit-learn-22013@bb766cc | scikit-learn/scikit-learn | Python | 22,013 | DOC Update plot_partial_dependence.py | PDP's are represented with orange line in the plot
<!--
Thanks for contributing a pull request! Please ensure you have taken a look at
the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md
-->
#### Reference Issues/PRs
Fixes #22006
<!--
Example: Fixes #1234. See... | 2021-12-17T17:39:17Z | Typo Error in PDP and ICE Plots examples
### Describe the issue linked to the documentation
There is a small typo error in the documentation under Examples/Inspection/Partial Dependence and Individual Conditional Expectation Plots.
Under the heading 'Analysis of the plots', there is a typo error in the first line:... | True we improved the colour but forgot to look at the description. @adijohar do you want to propose a PR to solve this typo. | [
{
"body": "### Describe the issue linked to the documentation\n\nThere is a small typo error in the documentation under Examples/Inspection/Partial Dependence and Individual Conditional Expectation Plots. \r\n\r\nUnder the heading 'Analysis of the plots', there is a typo error in the first line:\r\nWe can clear... | ec3bb7f4b33c358ca75ff0ab20564c6c58eea5d9 | {
"head_commit": "bb766ccc793778a43bafb1e00813d13482b9c337",
"head_commit_message": "Update plot_partial_dependence.py\n\nPDP's are represented with orange lines in the plot",
"patch_to_review": "diff --git a/examples/inspection/plot_partial_dependence.py b/examples/inspection/plot_partial_dependence.py\nindex 94... | [
{
"diff_hunk": "@@ -191,7 +191,7 @@\n # Analysis of the plots\n # .....................\n #\n-# We can clearly see on the PDPs (thick blue line) that the median house price\n+# We can clearly see on the PDPs (thick orange line) that the median house price",
"line": null,
"original_line": 194,
"origi... | 9964a843a5805943a7cb5e854a3a8447838cd8b3 | diff --git a/examples/inspection/plot_partial_dependence.py b/examples/inspection/plot_partial_dependence.py
index 948e0a0fafd54..a752c72e6279a 100644
--- a/examples/inspection/plot_partial_dependence.py
+++ b/examples/inspection/plot_partial_dependence.py
@@ -191,7 +191,7 @@
# Analysis of the plots
# .................. | {
"difficulty": "low",
"estimated_review_effort": 1,
"problem_domain": "Documentation Updates"
} |
saltstack__salt-63238@42bf239 | saltstack/salt | Python | 63,238 | Fix serious performance issues with the file.tidied module | ### What does this PR do?
See issue for details
### What issues does this PR fix or reference?
Fixes: #63231
### Previous Behavior
Long run times for `file.tidied` if a given directory during the walk had _a lot_ of subdirectories.
### New Behavior
Mo fasta
### Merge requirements satisfied?
**[NOTICE] ... | 2022-12-07T14:10:16Z | [BUG] serious performance issues with the file.tidied module
**Description**
We ran into some serious performance issues with the file.tidied module. We have a temp directory with 500k files under it. A pure python `os.walk` with a `stat` of each file + dir takes 2.3s. However salt runs on that host are taking almost ... | Ended up tracking the issue down to this line:
https://github.com/saltstack/salt/blob/fb1b562104db6944eabeb83b828992a72adab51d/salt/states/file.py#L2155
One directory had 61k directories in it, so performing a "is this string in this list" check was very costly. PR incoming. | [
{
"body": "**Description**\r\nWe ran into some serious performance issues with the file.tidied module. We have a temp directory with 500k files under it. A pure python `os.walk` with a `stat` of each file + dir takes 2.3s. However salt runs on that host are taking almost an hour with tons of CPU time spent by S... | 21463a2f46c470d3f48606ead255ea9e5c81ffbb | {
"head_commit": "42bf2396f91770665a130f72622b1540a274bf9a",
"head_commit_message": "fix test for new file.tidied operation",
"patch_to_review": "diff --git a/changelog/63231.fixed b/changelog/63231.fixed\nnew file mode 100644\nindex 000000000000..cda743d7bc4a\n--- /dev/null\n+++ b/changelog/63231.fixed\n@@ -0,0 ... | [
{
"diff_hunk": "@@ -2134,44 +2138,41 @@ def _matches(name):\n path = os.path.join(root, elem)\n try:\n if os.path.islink(path):\n- # Get timestamp of symlink (not symlinked file)\n- if time_comparison == \"ctime\":\n- ... | 9a973ab2f211a534df5432759c19c3dd691b15a7 | diff --git a/changelog/63231.fixed b/changelog/63231.fixed
new file mode 100644
index 000000000000..cda743d7bc4a
--- /dev/null
+++ b/changelog/63231.fixed
@@ -0,0 +1 @@
+Fix serious performance issues with the file.tidied module
diff --git a/salt/states/file.py b/salt/states/file.py
index e76a7cdd97e7..b8b6964f33c9 100... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Performance Optimizations"
} |
scikit-learn__scikit-learn-21991@2372615 | scikit-learn/scikit-learn | Python | 21,991 | FIX Improves feature names support for SelectFromModel + Est w/o names | <!--
Thanks for contributing a pull request! Please ensure you have taken a look at
the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md
-->
#### Reference Issues/PRs
<!--
Example: Fixes #1234. See also #3456.
Please use keywords (e.g., Fixes) to create link to th... | 2021-12-15T21:32:45Z | SelectFromModel function in scikit 1.0.1 does not work properly with catboost and caching
### Describe the bug
Problem: SelectFromModel function in scikit 1.01 does not work properly with catboost as it seems to delete column names,
making the return get_feature_names_out not return proper column names. This le... | At a first glance, I think that the validation of `n_features_in_` in `SelectFromModel` is delegated to the model used for selecting. Since `catboost` does not implement the `n_features_in_` API, then it fails.
While I think that our implementation is right here, I think that we should have raised a warning at least... | [
{
"body": "### Describe the bug\r\n\r\nProblem: SelectFromModel function in scikit 1.01 does not work properly with catboost as it seems to delete column names,\r\nmaking the return get_feature_names_out not return proper column names. This leads to additional problems when combining catboost and Scikit Learn... | 5de723d2f974e988cd6aaf86ff3b2c8c796e04d0 | {
"head_commit": "2372615f972bb509f41228c2b68a79eacbd90a40",
"head_commit_message": "DOC Adds whats new PR number",
"patch_to_review": "diff --git a/doc/whats_new/v1.0.rst b/doc/whats_new/v1.0.rst\nindex ce9069a6e8671..bc7cbb883626e 100644\n--- a/doc/whats_new/v1.0.rst\n+++ b/doc/whats_new/v1.0.rst\n@@ -35,6 +35,... | [
{
"diff_hunk": "@@ -428,3 +428,34 @@ def test_importance_getter(estimator, importance_getter):\n )\n selector.fit(data, y)\n assert selector.transform(data).shape[1] == 1\n+\n+\n+class RandomForestNoFeatureNames(RandomForestClassifier):",
"line": null,
"original_line": 433,
"original_sta... | c49d78c7e4a3675dfae9cd09f4f6b6806abc7b6e | diff --git a/doc/whats_new/v1.0.rst b/doc/whats_new/v1.0.rst
index 399f225145c16..8608688f715ee 100644
--- a/doc/whats_new/v1.0.rst
+++ b/doc/whats_new/v1.0.rst
@@ -35,6 +35,13 @@ Changelog
and :class:`decomposition.MiniBatchSparsePCA` to be convex and match the referenced
article. :pr:`19210` by :user:`Jérémie d... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
scikit-learn__scikit-learn-23099@5275179 | scikit-learn/scikit-learn | Python | 23,099 | FIX add `n_targets` allowing consistent shape prediction before calling `fit` in GPR | Fixes #22430
<!--
Thanks for contributing a pull request! Please ensure you have taken a look at
the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md
-->
#### Reference Issues/PRs
<!--
Example: Fixes #1234. See also #3456.
Please use keywords (e.g., Fixes) to c... | 2022-04-10T13:13:15Z | GPR `sample_y` enforce `n_targets=1` before calling `fit`
In `GaussianProcessRegressor`, sampling in the prior before calling `fit` via `sample_y` will assume that `y` is made of a single target. However, this is not necessarily the case. Therefore, the shape of the output of `sample_y` before and after `fit` is differ... | I see that we have the same issue with `predict` indeed. | [
{
"body": "In `GaussianProcessRegressor`, sampling in the prior before calling `fit` via `sample_y` will assume that `y` is made of a single target. However, this is not necessarily the case. Therefore, the shape of the output of `sample_y` before and after `fit` is different.\r\n\r\nIn order to solve this inco... | 42d235924efa64987a19e945035c85414c53d4f0 | {
"head_commit": "52751790f929b3027024dcdb926dc634b3690820",
"head_commit_message": "fix test case",
"patch_to_review": "diff --git a/sklearn/gaussian_process/_gpr.py b/sklearn/gaussian_process/_gpr.py\nindex c7d8db7b63702..4ba094bd31fcd 100644\n--- a/sklearn/gaussian_process/_gpr.py\n+++ b/sklearn/gaussian_proce... | [
{
"diff_hunk": "@@ -378,12 +386,26 @@ def predict(self, X, return_std=False, return_cov=False):\n )\n else:\n kernel = self.kernel\n- y_mean = np.zeros(X.shape[0])\n+\n+ n_targets = self.n_targets or 1",
"line": null,
"original_line": 390... | c401b43e01e267b82e332721976704b749f75aae | diff --git a/doc/whats_new/v1.3.rst b/doc/whats_new/v1.3.rst
index 38bf60ab4cd64..533409bc55344 100644
--- a/doc/whats_new/v1.3.rst
+++ b/doc/whats_new/v1.3.rst
@@ -456,6 +456,13 @@ Changelog
`'matching'` anymore.
:pr:`26264` by :user:`Barata T. Onggo <magnusbarata>`
+:mod:`sklearn.gaussian_process`
+............. | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} |
sqlfluff__sqlfluff-2652@37ecb20 | sqlfluff/sqlfluff | Python | 2,652 | Fix parsing types and add check to test in future | <!--Thanks for adding this feature!-->
<!--Please give the Pull Request a meaningful title for the release notes-->
### Brief summary of the change made
<!--Please include `fixes #XXXX` to automatically close any corresponding issue when the pull request is merged. Alternatively if not fully closed you can say `... | 2022-02-15T06:17:43Z | L052 Error: unable to identify statement terminated by `;`
<!--If this is a parsing or linting issue, please include a minimal SQL example which reproduces the issue, along with the `sqlfluff parse` output, `sqlfluff lint` output and `sqlfluff fix` output when relevant.-->
## Expected Behaviour
No error from L052; ... | [
{
"body": "<!--If this is a parsing or linting issue, please include a minimal SQL example which reproduces the issue, along with the `sqlfluff parse` output, `sqlfluff lint` output and `sqlfluff fix` output when relevant.-->\r\n\r\n## Expected Behaviour\r\nNo error from L052; previously worked w/o throwing err... | 67116c8cbc1a15c1cae3c088e4f8b8c8a9754695 | {
"head_commit": "37ecb209eb1f90d010ad6cd403ab540b84ad19dc",
"head_commit_message": "Update src/sqlfluff/rules/L052.py\n\nCo-authored-by: Barry Hart <barrywhart@yahoo.com>",
"patch_to_review": "diff --git a/src/sqlfluff/dialects/dialect_ansi.py b/src/sqlfluff/dialects/dialect_ansi.py\nindex 2a2d9306109..e8179b241... | [
{
"diff_hunk": "@@ -2212,6 +2213,7 @@ class PartitionBoundSpecSegment(BaseSegment):\n As per https://www.postgresql.org/docs/13/sql-altertable.html.\n \"\"\"\n \n+ type = \"partition_bound_segment\"",
"line": null,
"original_line": 2216,
"original_start_line": null,
"path": "src/sqlfl... | 4ab839e3402b2fc9443cd469f5b5d2b60f809113 | diff --git a/src/sqlfluff/dialects/dialect_ansi.py b/src/sqlfluff/dialects/dialect_ansi.py
index 2a2d9306109..4f11712c551 100644
--- a/src/sqlfluff/dialects/dialect_ansi.py
+++ b/src/sqlfluff/dialects/dialect_ansi.py
@@ -2364,7 +2364,7 @@ class IndexColumnDefinitionSegment(BaseSegment):
class TableConstraintSegment(Ba... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Code Style, Linting, Formatting Fixes"
} | |
scikit-learn__scikit-learn-22506@fe36187 | scikit-learn/scikit-learn | Python | 22,506 | ENH Adds feature_name_combiner to OneHotEncoder | This change makes sure that `OneHotEncoder.get_feature_names_out` returns unique feature names, as every transformer should do. The approach is different than discussed in the issue, erring on the side of working by default, rather than forcing the user to provide a custom function that transforms (feature_name, value)... | 2022-02-16T14:03:18Z | OneHotEncoder creates non unique column names, when values None (NoneType) and "None" (str) are both present
### Describe the bug
OneHotEncoder creates non unique column names when values None (NoneType) and "None" (str) are both present in the same column.
Such policy creates downstream problems (e.g. ColumnTransf... | Indeed, the expected behaviour would be to get 2 different names there.
I could imagine that we could have the same bug with names reserved in Python (e.g. True vs "True").
It should be possible to detect the collision since the `repr` of `None` and `"None"` will differ.
However, I don't know if we should error or... | [
{
"body": "### Describe the bug\n\nOneHotEncoder creates non unique column names when values None (NoneType) and \"None\" (str) are both present in the same column.\r\n\r\nSuch policy creates downstream problems (e.g. ColumnTransformer raising because of non unique column names).\r\n\r\nIt's not 100% clear to m... | 93533ddaff16b30d759936513162579ccecef502 | {
"head_commit": "fe361871b0ade932a063080f2c7c7da889cc0aa3",
"head_commit_message": "Update sklearn/preprocessing/_encoders.py\n\nCo-authored-by: Christian Lorentzen <lorentzen.ch@gmail.com>",
"patch_to_review": "diff --git a/doc/whats_new/v1.1.rst b/doc/whats_new/v1.1.rst\nindex f6dc1f311ad3c..97238b6211ea6 1006... | [
{
"diff_hunk": "@@ -319,6 +319,13 @@ class OneHotEncoder(_BaseEncoder):\n .. versionadded:: 1.1\n Read more in the :ref:`User Guide <one_hot_encoder_infrequent_categories>`.\n \n+ feature_name_combiner : {'concat_string'} or Callable, default='concat_string'\n+ Callable with signat... | 0dba09216f507b3c04dcc46ce91f334fdca5c116 | diff --git a/doc/whats_new/v1.3.rst b/doc/whats_new/v1.3.rst
index e62a238468dc3..0c8de4a02409b 100644
--- a/doc/whats_new/v1.3.rst
+++ b/doc/whats_new/v1.3.rst
@@ -133,6 +133,13 @@ Changelog
:mod:`sklearn.preprocessing`
............................
+
+- |Enhancement| Adds a `feature_name_combiner` parameter to
+ ... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
saltstack__salt-63175@7ab679d | saltstack/salt | Python | 63,175 | push dep of neutron | ### What does this PR do?
Push dep of neutron module
### What issues does this PR fix or reference?
Fixes: https://github.com/saltstack/salt/issues/49430
- [x] Changelog - https://docs.saltproject.io/en/master/topics/development/changelog.html
| 2022-12-01T18:23:27Z | Handle deprecated neutron module
- [ ] salt/utils/openstack/neutron.py
The neutron module has been replaced with neutronng.py. Anything relying on the neutron utils module must be addressed.
Don't forget to remove the autodoc files + references, as well as the stale doc files on the doc build server. | going to bump the warn until version to aluminium due to this blocker: https://github.com/saltstack/salt/issues/55663
I accidentally opened a duplicate about this! Copy/paste of what I had:
----
The [salt/utils/openstack/neutron.py](https://github.com/saltstack/salt/blob/master/salt/utils/openstack/neutron.py) ut... | [
{
"body": "- [ ] salt/utils/openstack/neutron.py\r\n\r\nThe neutron module has been replaced with neutronng.py. Anything relying on the neutron utils module must be addressed.\r\n\r\nDon't forget to remove the autodoc files + references, as well as the stale doc files on the doc build server.",
"number": 49... | b7da9d2ef2da3839fbf9aaf8f2424c26b127523e | {
"head_commit": "7ab679d689d00f34bc1d73646b23a0d981bcdc00",
"head_commit_message": "Merge branch 'master' into move_n_dep",
"patch_to_review": "diff --git a/changelog/49430.changed b/changelog/49430.changed\nnew file mode 100644\nindex 000000000000..dbfd52047cc1\n--- /dev/null\n+++ b/changelog/49430.changed\n@@ ... | [
{
"diff_hunk": "@@ -0,0 +1 @@\n+move dep of neutron to Argon. Pls move to neutronng",
"line": null,
"original_line": 1,
"original_start_line": null,
"path": "changelog/49430.changed",
"start_line": null,
"text": "@user1:\n```suggestion\r\nMove deprecation of the neutron module to Argon. ... | 9773088e34a4a04c2a104fdae35bc7675ef772f8 | diff --git a/changelog/49430.changed b/changelog/49430.changed
new file mode 100644
index 000000000000..4e94ec3f596f
--- /dev/null
+++ b/changelog/49430.changed
@@ -0,0 +1 @@
+Move deprecation of the neutron module to Argon. Please migrate to the neutronng module instead.
diff --git a/salt/utils/openstack/neutron.py b/... | {
"difficulty": "low",
"estimated_review_effort": 2,
"problem_domain": "Code Refactoring / Architectural Improvement"
} |
saltstack__salt-64028@d9e8dfa | saltstack/salt | Python | 64,028 | [master] file.keyvalue should allow creating a file if it doesn't exist | ### What does this PR do?
Adds the `create_if_missing` parameter to handle basic file creation for `file.keyvalue`
### What issues does this PR fix or reference?
Fixes: #63545
### Previous Behavior
`file.keyvalue` could not create a file, so `file.touch` or `file.managed` without content were often used.
##... | 2023-04-05T16:21:44Z | file.keyvalue should create the file if it doesn't exist
If you don't yet have a file that you would like to create by key/value pairs, then this state should just create it.
Or at least be able to do it by using a "create=xxx" option. | Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey.
Please be sure to review our [Code... | [
{
"body": "If you don't yet have a file that you would like to create by key/value pairs, then this state should just create it.\r\nOr at least be able to do it by using a \"create=xxx\" option.",
"number": 63545,
"title": "file.keyvalue should create the file if it doesn't exist"
}
] | 00dce8d08a91e4c075897ff8d4ed1977a7d98852 | {
"head_commit": "d9e8dfa6b42532f486294aba346f58934fcecc79",
"head_commit_message": "Merge branch 'master' into add-keyvalue-create_if_missing",
"patch_to_review": "diff --git a/changelog/63545.added.md b/changelog/63545.added.md\nnew file mode 100644\nindex 000000000000..c53ef8dda802\n--- /dev/null\n+++ b/change... | [
{
"diff_hunk": "@@ -5564,7 +5570,16 @@ def keyvalue(\n try:\n with salt.utils.files.fopen(name, \"r\") as fd:\n file_contents = fd.readlines()\n- except OSError:\n+ fd.close()",
"line": null,
"original_line": 5573,
"original_start_line": null,
"path": "salt/... | 461868daf5679f022b9054fd4cd684d78eec226b | diff --git a/changelog/63545.added.md b/changelog/63545.added.md
new file mode 100644
index 000000000000..c53ef8dda802
--- /dev/null
+++ b/changelog/63545.added.md
@@ -0,0 +1 @@
+Add ability for file.keyvalue to create a file if it doesn't exist
diff --git a/salt/states/file.py b/salt/states/file.py
index f035635ee0a7.... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} |
sqlfluff__sqlfluff-2643@c4035f7 | sqlfluff/sqlfluff | Python | 2,643 | Postgres enhanced `DELETE FROM` syntax | <!--Thanks for adding this feature!-->
<!--Please give the Pull Request a meaningful title for the release notes-->
### Brief summary of the change made
<!--Please include `fixes #XXXX` to automatically close any corresponding issue when the pull request is merged. Alternatively if not fully closed you can say `... | 2022-02-14T21:34:53Z | [POSTGRES] Can't parse DELETE FROM [...] USING [...] WHERE
## Expected Behaviour
Query should be parsed without error
## Observed Behaviour
Query can't be parsed
## Steps to Reproduce
Run this minimal example with sqlfluff parse/lint:
```pgsql
DELETE FROM some_table
USING other_table
WHERE other... | [
{
"body": "\r\n## Expected Behaviour\r\n\r\nQuery should be parsed without error\r\n\r\n## Observed Behaviour\r\n\r\nQuery can't be parsed\r\n\r\n## Steps to Reproduce\r\n\r\nRun this minimal example with sqlfluff parse/lint:\r\n\r\n```pgsql\r\nDELETE FROM some_table\r\nUSING other_table\r\nWHERE other_table.co... | 9ceda77cd20ec163b5952f25773e79c153587120 | {
"head_commit": "c4035f79a0e3e6907d565475865df8cbbf27cd57",
"head_commit_message": "Test cases",
"patch_to_review": "diff --git a/src/sqlfluff/dialects/dialect_postgres.py b/src/sqlfluff/dialects/dialect_postgres.py\nindex d62d4121173..2c359d364ff 100644\n--- a/src/sqlfluff/dialects/dialect_postgres.py\n+++ b/sr... | [
{
"diff_hunk": "@@ -3638,3 +3649,81 @@ class ValuesClauseSegment(BaseSegment):\n # TO DO - CHECK OFFSET\n # TO DO - FETCH\n )\n+\n+\n+@postgres_dialect.segment()\n+class DeleteUsingClauseSegment(BaseSegment):\n+ \"\"\"USING clause.\"\"\"\n+\n+ type = \"using_clause\"\n+ match_gramma... | 84221ad804930b61fc4ca114043e225f50015caa | diff --git a/src/sqlfluff/dialects/dialect_postgres.py b/src/sqlfluff/dialects/dialect_postgres.py
index d62d4121173..01a06bbc146 100644
--- a/src/sqlfluff/dialects/dialect_postgres.py
+++ b/src/sqlfluff/dialects/dialect_postgres.py
@@ -17,6 +17,7 @@
SymbolSegment,
StartsWith,
CommentSegment,
+ Indent... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Bug Fixes"
} | |
scikit-learn__scikit-learn-21757@2801cc8 | scikit-learn/scikit-learn | Python | 21,757 | ENH improve error message when y_true does not provide all known classes | closes #21568
Improve the error message raised in `top_k_accuracy_score` by stipulating to assign the known classes to labels when `y_true` does not contain all potential labels. | 2021-11-23T13:01:06Z | top_k_accuracy_score fails when y_true contains labels not in labels
### Describe the bug
If, during train/test split, one of the classes in a multi-label problem is omitted from the training set but *is* included in the testing set, "top_k_accuracy_score" fails instead of just returning 0 for that particularly score.... | Thanks for the report @meesatsquare ! I think it's an instance of https://github.com/scikit-learn/scikit-learn/issues/21250 and there is a proposed documentation improvement in https://github.com/scikit-learn/scikit-learn/pull/21255
> "top_k_accuracy_score" effectively functions by looking at the top k probabilities... | [
{
"body": "### Describe the bug\n\nIf, during train/test split, one of the classes in a multi-label problem is omitted from the training set but *is* included in the testing set, \"top_k_accuracy_score\" fails instead of just returning 0 for that particularly score. \n\n### Steps/Code to Reproduce\n\n```\r\nX_t... | 4dfaaf9645d48dc791397ec4d87b54455a89bd13 | {
"head_commit": "2801cc838d0bf0a65e220801d4f427edf56df306",
"head_commit_message": "DOC improve error message when y_true does not provide all known classes",
"patch_to_review": "diff --git a/sklearn/metrics/_ranking.py b/sklearn/metrics/_ranking.py\nindex 0707c8d2a951d..6c8593a2da5ce 100644\n--- a/sklearn/metri... | [
{
"diff_hunk": "@@ -1719,6 +1719,8 @@ def top_k_accuracy_score(\n raise ValueError(\n f\"Number of classes in 'y_true' ({n_classes}) not equal \"\n f\"to the number of classes in 'y_score' ({y_score_n_classes}).\"\n+ \"You can provide a list of all know... | 9598b7baf1b4c4ef90cc58c9fc3803dc4fa2c03b | diff --git a/sklearn/metrics/_ranking.py b/sklearn/metrics/_ranking.py
index 0707c8d2a951d..1d3be5fdf499a 100644
--- a/sklearn/metrics/_ranking.py
+++ b/sklearn/metrics/_ranking.py
@@ -1719,6 +1719,8 @@ def top_k_accuracy_score(
raise ValueError(
f"Number of classes in 'y_true' ({n_classes... | {
"difficulty": "low",
"estimated_review_effort": 2,
"problem_domain": "Bug Fixes"
} |
sqlfluff__sqlfluff-2607@5a467fd | sqlfluff/sqlfluff | Python | 2,607 | Allow Bare Functions in column constraints | <!--Thanks for adding this feature!-->
<!--Please give the Pull Request a meaningful title for the release notes-->
### Brief summary of the change made
<!--Please include `fixes #XXXX` to automatically close any corresponding issue when the pull request is merged. Alternatively if not fully closed you can say `... | 2022-02-10T17:44:33Z | SQLITE: TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP not parsable
<!--If this is a parsing or linting issue, please include a minimal SQL example which reproduces the issue, along with the `sqlfluff parse` output, `sqlfluff lint` output and `sqlfluff fix` output when relevant.-->
## Expected Behaviour
sqlite3 is ... | Fixed in #2607
Can you raise a separate issue if yoiu also need the `PRAGMA` statement to be parsable? | [
{
"body": "<!--If this is a parsing or linting issue, please include a minimal SQL example which reproduces the issue, along with the `sqlfluff parse` output, `sqlfluff lint` output and `sqlfluff fix` output when relevant.-->\r\n\r\n## Expected Behaviour\r\n\r\nsqlite3 is parsed successfully\r\n\r\n## Observed ... | 27664796f676f92c8f07769e78294022f188d331 | {
"head_commit": "5a467fddb348a8b51a887f30c2666183820b22e1",
"head_commit_message": "Merge branch 'main' into barefunction-column-constraint",
"patch_to_review": "diff --git a/src/sqlfluff/dialects/dialect_ansi.py b/src/sqlfluff/dialects/dialect_ansi.py\nindex 93197d8d72c..a8a67472853 100644\n--- a/src/sqlfluff/d... | [
{
"diff_hunk": "@@ -2321,6 +2321,7 @@ class ColumnConstraintSegment(BaseSegment):\n OneOf(\n Ref(\"LiteralGrammar\"),\n Ref(\"FunctionSegment\"),\n+ Ref(\"BareFunctionSegment\"),\n # ?? Ref('IntervalExpressionSegment'... | 02ffa10298e2ab87f1ac12c443e9574d9d21f117 | diff --git a/src/sqlfluff/dialects/dialect_ansi.py b/src/sqlfluff/dialects/dialect_ansi.py
index 93197d8d72c..2a2d9306109 100644
--- a/src/sqlfluff/dialects/dialect_ansi.py
+++ b/src/sqlfluff/dialects/dialect_ansi.py
@@ -2321,7 +2321,7 @@ class ColumnConstraintSegment(BaseSegment):
OneOf(
... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
sqlfluff__sqlfluff-2610@211ed12 | sqlfluff/sqlfluff | Python | 2,610 | L052: If require_final_semicolon is set, ensure semicolon after ALL statements | <!--Thanks for adding this feature!-->
<!--Please give the Pull Request a meaningful title for the release notes-->
### Brief summary of the change made
Fixes #2588
<!--Please include `fixes #XXXX` to automatically close any corresponding issue when the pull request is merged. Alternatively if not fully closed ... | 2022-02-10T22:42:04Z | Extend Rule L052 to handle all statements
I would expect that rule L052 would append a semi-colon to all statements missing one, but it looks like its current intent is not to do this. Can we extend the rule?
## Expected Behaviour
The following code
```
CREATE FUNCTION dbo.funxn (
@incoming varchar(50)
)... | Can't repeat this. This adds the semicolon for me in both 0.9.4 and `main`.
That's definitely the config you're using?
@tunetheweb you're right that a final semi-colon is added. I adjusted the example to reflect that just now.
My concern is with the statements within the function. Would it be possible to add ... | [
{
"body": "I would expect that rule L052 would append a semi-colon to all statements missing one, but it looks like its current intent is not to do this. Can we extend the rule?\r\n\r\n## Expected Behaviour\r\n\r\nThe following code\r\n```\r\nCREATE FUNCTION dbo.funxn (\r\n @incoming varchar(50)\r\n) RETURN... | dbc718719b8b463b6f8c0572d3f75ba8ac0f4c19 | {
"head_commit": "211ed12eb456d58c40045af2a366666dcbe30561",
"head_commit_message": "Merge branch 'main' into bhart-issue_2588_rule_l052_add_semicolon_all_statements",
"patch_to_review": "diff --git a/src/sqlfluff/core/rules/base.py b/src/sqlfluff/core/rules/base.py\nindex 2706f9d792d..6468b5c3aea 100644\n--- a/s... | [
{
"diff_hunk": "@@ -292,20 +353,41 @@ def _eval(self, context: RuleContext) -> Optional[LintResult]:\n ) = self._handle_preceding_inline_comments(\n pre_semicolon_segments, anchor_segment\n )\n- fixes = [\n- ... | 0d8fcb622f90f30f97503b0d876b3cc5b2192531 | diff --git a/src/sqlfluff/core/rules/base.py b/src/sqlfluff/core/rules/base.py
index fed7ff602a9..deb181a226f 100644
--- a/src/sqlfluff/core/rules/base.py
+++ b/src/sqlfluff/core/rules/base.py
@@ -645,8 +645,7 @@ def indent(self) -> str:
space = " "
return space * self.tab_space_size if self.indent_un... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "New Feature Additions"
} |
scikit-learn__scikit-learn-21809@1f0e8c9 | scikit-learn/scikit-learn | Python | 21,809 | API Deprecates values in partial_dependence in favor of pdp_values | <!--
Thanks for contributing a pull request! Please ensure you have taken a look at
the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md
-->
#### Reference Issues/PRs
<!--
Example: Fixes #1234. See also #3456.
Please use keywords (e.g., Fixes) to create link to th... | 2021-11-28T17:16:06Z | Conflict between key-values and build-in method name in `Bunch`
### Describe the bug
This is unfortunate but there is a clash between the `values` key and the `values` build-in method in the `Bunch` returned by `partial_dependence`.
### Steps/Code to Reproduce
```python
In [1]: X = [[0, 0, 2], [1, 0, 0]]
...: y... | I really think we should rename `values` here to something else. | [
{
"body": "### Describe the bug\n\nThis is unfortunate but there is a clash between the `values` key and the `values` build-in method in the `Bunch` returned by `partial_dependence`.\n\n### Steps/Code to Reproduce\n\n```python\r\nIn [1]: X = [[0, 0, 2], [1, 0, 0]]\r\n ...: y = [0, 1]\r\n ...: from sklearn.i... | ef5c0879e1367397f671791cdfad46eef8892826 | {
"head_commit": "1f0e8c99b84f58e264166fb57064e1ec05f230cb",
"head_commit_message": "Merge remote-tracking branch 'upstream/main' into bunch_deprecate_values",
"patch_to_review": "diff --git a/doc/whats_new/v1.3.rst b/doc/whats_new/v1.3.rst\nindex e4e965aca02d8..5aa36b817c2d5 100644\n--- a/doc/whats_new/v1.3.rst\... | [
{
"diff_hunk": "@@ -836,3 +837,31 @@ def test_kind_average_and_average_of_individual(Estimator, data):\n pdp_ind = partial_dependence(est, X=X, features=[1, 2], kind=\"individual\")\n avg_ind = np.mean(pdp_ind[\"individual\"], axis=1)\n assert_allclose(avg_ind, pdp_avg[\"average\"])\n+\n+\n+# TODO(1... | 47620c7f1dd9b4ac0ddfb4ee684f64598d19ba42 | diff --git a/doc/whats_new/v1.3.rst b/doc/whats_new/v1.3.rst
index 57f404854b1dd..2e86db81c00c8 100644
--- a/doc/whats_new/v1.3.rst
+++ b/doc/whats_new/v1.3.rst
@@ -159,6 +159,14 @@ Changelog
- |Enhancement| Added the parameter `fill_value` to :class:`impute.IterativeImputer`.
:pr:`25232` by :user:`Thijs van Weezel... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
scikit-learn__scikit-learn-21724@e684fe7 | scikit-learn/scikit-learn | Python | 21,724 | FIX Fix warning for ElasticNetCV l1_ratio=0 | #### Reference Issues/PRs
Fixes #21644.
#### What does this implement/fix? Explain your changes.
The warning for `alpha=0` is modified in `cd_fast.enet_coordinate_descent_gram`.
#### Any other comments?
Maybe another PR can be done to modify the parameter names in `cd_fast` enet gradient descent methods from `... | 2021-11-21T00:43:11Z | ElasticNetCV call with l1_ratio=0 produces warning incorrectly identifying alpha=0 as the issue
Run the following:
```python
from sklearn.linear_model import ElasticNetCV
from sklearn.datasets import make_regression
X, y = make_regression(n_features=2, random_state=0)
test = ElasticNetCV(l1_ratio=[0, 0], alphas=... | I can reproduce with `main`.
### Potential problem
I think the problem is that for the gradient descent of LassoCV and ElasticNetCV, `enet_coordinate_descent_gram()` is called which takes in `alpha` and `beta` to minimize `(1/2) * ||y - Xw||^2_2 + alpha * ||w||_1 + (beta/2) * ||w||^2_2 `.
https://github.com/sciki... | [
{
"body": "Run the following:\r\n\r\n```python\r\nfrom sklearn.linear_model import ElasticNetCV\r\nfrom sklearn.datasets import make_regression\r\nX, y = make_regression(n_features=2, random_state=0)\r\ntest = ElasticNetCV(l1_ratio=[0, 0], alphas=[1, 1])\r\ntest.fit(X, y)\r\n```\r\n\r\nThis results in the warni... | 26e2c38a961a27a9e53ce7814bf27f840510b237 | {
"head_commit": "e684fe7a0cd93c3dd73d346fbed93c468e31ceca",
"head_commit_message": "Apply suggestions from code review\n\nCo-authored-by: Julien Jerphanion <git@jjerphan.xyz>",
"patch_to_review": "diff --git a/doc/whats_new/v1.1.rst b/doc/whats_new/v1.1.rst\nindex 61d5c64255f71..c30ee4b2fc239 100644\n--- a/doc/w... | [
{
"diff_hunk": "@@ -1280,6 +1280,15 @@ def test_enet_l1_ratio():\n with pytest.raises(ValueError, match=msg):\n MultiTaskElasticNetCV(l1_ratio=0, random_state=42).fit(X, y[:, None])\n \n+ # Test that l1_ratio=0 with alpha>0 produces user warning\n+ warning_message = (\n+ \"Coordinate de... | 43ddb6f5033ebeaeb6b9186683b1a7c0490f95de | diff --git a/doc/whats_new/v1.1.rst b/doc/whats_new/v1.1.rst
index 61d5c64255f71..c30ee4b2fc239 100644
--- a/doc/whats_new/v1.1.rst
+++ b/doc/whats_new/v1.1.rst
@@ -319,6 +319,10 @@ Changelog
:pr:`21481` by :user:`Guillaume Lemaitre <glemaitre>` and
:user:`Andrés Babino <ababino>`.
+- |Fix| :class:`linear_model... | {
"difficulty": "low",
"estimated_review_effort": 2,
"problem_domain": "Bug Fixes"
} |
sqlfluff__sqlfluff-2582@9ceeb88 | sqlfluff/sqlfluff | Python | 2,582 | Exasol: Allow multiple `LOCAL` keywords in `WHERE` clause | <!--Thanks for adding this feature!-->
<!--Please give the Pull Request a meaningful title for the release notes-->
### Brief summary of the change made
<!--Please include `fixes #XXXX` to automatically close any corresponding issue when the pull request is merged. Alternatively if not fully closed you can say `... | 2022-02-08T20:03:08Z | Exasol: `LOCAL` may not working in `WHERE` clause
<!--If this is a parsing or linting issue, please include a minimal SQL example which reproduces the issue, along with the `sqlfluff parse` output, `sqlfluff lint` output and `sqlfluff fix` output when relevant.-->
## Expected Behaviour
Statement must be parsable
... | This is not strictly true. It parses the first one, but not the second.
```
[L: 2, P: 7] | start_bracket: '('
[L: 2, P: 8] | [META] indent:
[L: 2, P: 8] | expression:
[L: 2, P: 8] | ... | [
{
"body": "<!--If this is a parsing or linting issue, please include a minimal SQL example which reproduces the issue, along with the `sqlfluff parse` output, `sqlfluff lint` output and `sqlfluff fix` output when relevant.-->\r\n\r\n## Expected Behaviour\r\nStatement must be parsable\r\n\r\n## Observed Behaviou... | 59c2c4b84de2b222c72fa605c07f3d0e22f35542 | {
"head_commit": "9ceeb88df9cdbc15caac5dc8f4ca23aafa4bb513",
"head_commit_message": "Add explanation\n\nCo-authored-by: Barry Pollard <barry_pollard@hotmail.com>",
"patch_to_review": "diff --git a/src/sqlfluff/dialects/dialect_ansi.py b/src/sqlfluff/dialects/dialect_ansi.py\nindex a994276dbb7..cefa673855b 100644\... | [
{
"diff_hunk": "@@ -1715,6 +1715,7 @@ class CaseExpressionSegment(BaseSegment):\n \"FunctionSegment\"\n ), # WHERE (a, substr(b,1,3)) IN (select c,d FROM...)\n Ref(\"LiteralGrammar\"), # WHERE (a, 2) IN (SELECT b, c FROM ...)\n+ ... | f29e8b8d2ea910ac6bed1dd3b799b07a95a24b58 | diff --git a/src/sqlfluff/dialects/dialect_ansi.py b/src/sqlfluff/dialects/dialect_ansi.py
index a994276dbb7..bc816fd7123 100644
--- a/src/sqlfluff/dialects/dialect_ansi.py
+++ b/src/sqlfluff/dialects/dialect_ansi.py
@@ -1715,6 +1715,7 @@ class CaseExpressionSegment(BaseSegment):
"FunctionS... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
sqlfluff__sqlfluff-2589@7d773a1 | sqlfluff/sqlfluff | Python | 2,589 | L016: New option "ignore_comment_clause" to ignore column COMMENTs, etc. | <!--Thanks for adding this feature!-->
<!--Please give the Pull Request a meaningful title for the release notes-->
### Brief summary of the change made
Fixes #2554
<!--Please include `fixes #XXXX` to automatically close any corresponding issue when the pull request is merged. Alternatively if not fully closed ... | 2022-02-09T18:46:58Z | Update L016 to optionally ignore long COMMENT lines as well
<!--Note: This is for general enhancements to the project. Please use the Bug report template instead to raise parsing/linting/syntax issues for existing supported dialects-->
For example:
```
CREATE OR REPLACE TABLE mytable (
col1 NUMBER COMMENT 'col1... | This is definitly something I would like to have too, and I can spend some time in trying to make it.
Only question that I have is "how to name this configuration?". I'm thinking about `ignore_too_long_description`. I don't want to use `comment` to not confuse people between "business comment" like the usage above (... | [
{
"body": "<!--Note: This is for general enhancements to the project. Please use the Bug report template instead to raise parsing/linting/syntax issues for existing supported dialects-->\r\nFor example:\r\n```\r\nCREATE OR REPLACE TABLE mytable (\r\n col1 NUMBER COMMENT 'col1 comment',\r\n col2 BOOLEAN CO... | c846a9e5c829258d7ee10d3136c26e4d28c819c3 | {
"head_commit": "7d773a16aff8fcfe7a3dcd19ba45e42fb0797910",
"head_commit_message": "Merge branch 'main' into bhart-issue_2554_l016_ignore_comment_clause",
"patch_to_review": "diff --git a/src/sqlfluff/core/default_config.cfg b/src/sqlfluff/core/default_config.cfg\nindex 4ff278c9c0b..f35cf80da71 100644\n--- a/src... | [
{
"diff_hunk": "@@ -29,6 +30,7 @@ class Rule_L016(Rule_L003):\n \"tab_space_size\",\n \"indent_unit\",\n \"ignore_comment_lines\",\n+ \"ignore_comment_clause\",",
"line": null,
"original_line": 33,
"original_start_line": null,
"path": "src/sqlfluff/rules/L016.py",
... | 0712f2e6299385e9b305bc197b3a5e90bda6d3ad | diff --git a/src/sqlfluff/core/default_config.cfg b/src/sqlfluff/core/default_config.cfg
index 4ff278c9c0b..e013359d2db 100644
--- a/src/sqlfluff/core/default_config.cfg
+++ b/src/sqlfluff/core/default_config.cfg
@@ -92,6 +92,7 @@ ignore_words = None
[sqlfluff:rules:L016]
# Line length
ignore_comment_lines = False
+... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Code Style, Linting, Formatting Fixes"
} |
sqlfluff__sqlfluff-2553@2d7c8b2 | sqlfluff/sqlfluff | Python | 2,553 | Spark3: Add Direct File Query | <!--Thanks for adding this feature!-->
<!--Please give the Pull Request a meaningful title for the release notes-->
### Brief summary of the change made
<!--Please include `fixes #XXXX` to automatically close any corresponding issue when the pull request is merged. Alternatively if not fully closed you can say `... | 2022-02-03T16:09:00Z | Issue with Databricks absolute path tables
We're using DBT with Databricks and tried to implement sqlfluff for linting. However, we're seeing that the following syntax is unsupported:
```sql
SELECT *
FROM delta.`/mnt/datalake/table`
```
Is this something that we want to support in sqlfluff? If so, I can try to... | hi @Fokko, glad to see you here!
sqlfluff has a modular approach to dialects, you should be able to see all the dialects here: https://github.com/sqlfluff/sqlfluff/tree/master/src/sqlfluff/core/dialects
I'm thinking you would need to implement a Spark SQL dialect (which would be awesome to have)
Related #417
T... | [
{
"body": "We're using DBT with Databricks and tried to implement sqlfluff for linting. However, we're seeing that the following syntax is unsupported:\r\n\r\n```sql\r\nSELECT *\r\nFROM delta.`/mnt/datalake/table`\r\n```\r\n\r\nIs this something that we want to support in sqlfluff? If so, I can try to come up w... | a8234db66bc6a3514c5d12c883dfb2af6b68cc53 | {
"head_commit": "2d7c8b25076f88f68c18e4bbe8825d318d06b6ee",
"head_commit_message": "switch QuotedIdentifierSegment to QuotedLiteralSegment inside FileReferenceSegment\n\nran sqlfluff fix on tests and updated yml again",
"patch_to_review": "diff --git a/src/sqlfluff/dialects/dialect_spark3.py b/src/sqlfluff/diale... | [
{
"diff_hunk": "@@ -270,18 +274,43 @@\n DatabasePropertiesGrammar=Sequence(\n \"DBPROPERTIES\", Ref(\"BracketedPropertyListGrammar\")\n ),\n- DataSourceFormatGrammar=OneOf(\n+ DataSourcesV2FileTypeGrammar=OneOf(\n+ # https://github.com/apache/spark/tree/master/sql/core/src/main/scal... | cdad74fc56cb01ba392685ccf9cb95526e06ec4d | diff --git a/src/sqlfluff/dialects/dialect_spark3.py b/src/sqlfluff/dialects/dialect_spark3.py
index 87287cdc986..701a3f9a2a5 100644
--- a/src/sqlfluff/dialects/dialect_spark3.py
+++ b/src/sqlfluff/dialects/dialect_spark3.py
@@ -207,7 +207,12 @@
)
spark3_dialect.add(
- # Add Hive Segments TODO : Is there a way t... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Code Style, Linting, Formatting Fixes"
} |
sqlfluff__sqlfluff-2547@baf92da | sqlfluff/sqlfluff | Python | 2,547 | Remove requirement for Click>=8 | <!--Thanks for adding this feature!-->
<!--Please give the Pull Request a meaningful title for the release notes-->
### Brief summary of the change made
<!--Please include `fixes #XXXX` to automatically close any corresponding issue when the pull request is merged. Alternatively if not fully closed you can say `... | 2022-02-02T23:01:39Z | Less strict click version
From what I get the pinned click requirement >= 8.0.0 was added to support autocompletion of the cli. Could that be made optional and the version requirement be lowered. It makes it difficult for us to combine in env with other old apps. It might be an edge case, I don't know but we get hit b... | I think that's a fair ask, since it's an optional extra. Does seem to be [causing other issues too](https://github.com/megalinter/megalinter/issues/1224). | [
{
"body": "From what I get the pinned click requirement >= 8.0.0 was added to support autocompletion of the cli. Could that be made optional and the version requirement be lowered. It makes it difficult for us to combine in env with other old apps. It might be an edge case, I don't know but we get hit by it th... | 0102303098ad547a1b918df3f69e0e224c3b8a10 | {
"head_commit": "baf92dabd3d736f6646fbc4b90b43d9c1dfa2c96",
"head_commit_message": "Add pragma no covers",
"patch_to_review": "diff --git a/requirements.txt b/requirements.txt\nindex 45ea07600cd..11dd55ba824 100644\n--- a/requirements.txt\n+++ b/requirements.txt\n@@ -5,7 +5,7 @@ appdirs\n backports.cached-proper... | [
{
"diff_hunk": "@@ -1,9 +1,15 @@\n \"\"\"autocompletion commands.\"\"\"\n \n-from click.shell_completion import CompletionItem\n-\n from sqlfluff import list_dialects\n \n+# Older versions of click don't have shell completion\n+# so handle for now, as version 8 still fairly recent\n+shell_completion_enabled = T... | 8d773695807d131453c729234dde98a04fa4053d | diff --git a/requirements.txt b/requirements.txt
index 45ea07600cd..11dd55ba824 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -5,7 +5,7 @@ appdirs
backports.cached-property; python_version < '3.8'
# To get the encoding of files.
chardet
-click>=8.0
+click
colorama>=0.3
# Used for diffcover plugin
diff-c... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Dependency Updates & Env Compatibility"
} |
sqlfluff__sqlfluff-2540@f7266c6 | sqlfluff/sqlfluff | Python | 2,540 | Adds new rule L062 to allow blocking of certain words | <!--Thanks for adding this feature!-->
<!--Please give the Pull Request a meaningful title for the release notes-->
### Brief summary of the change made
<!--Please include `fixes #XXXX` to automatically close any corresponding issue when the pull request is merged. Alternatively if not fully closed you can say `... | 2022-02-01T20:18:14Z | Blocklisting SQL vendor specific data types
Following Simon Holywell's SQL Style Guide, it would be nice to have a lint rule that you can config to check for SQL data types used in the query.
I.e. In BigQuery you can use the keyword `BOOL` or `BOOLEAN` to represent a boolean type, the lint rule could blacklist one o... | I like this rule. I think it would be best if sqlfluff could be opinionated about *which* of the available options is preferred too. From my perspective I would find this really useful with snowflake string types where `STRING`, `TEXT`, `CHAR` and `VARCHAR` are all equivalent.
@ericxiao251 do you expect there is eno... | [
{
"body": "Following Simon Holywell's SQL Style Guide, it would be nice to have a lint rule that you can config to check for SQL data types used in the query.\r\n\r\nI.e. In BigQuery you can use the keyword `BOOL` or `BOOLEAN` to represent a boolean type, the lint rule could blacklist one of those and enforce o... | ef7d86548757fcbc3405ac421c38acefa55db9aa | {
"head_commit": "f7266c6ecd2b82504884da64067382612fff4808",
"head_commit_message": "Review feedback",
"patch_to_review": "diff --git a/src/sqlfluff/core/default_config.cfg b/src/sqlfluff/core/default_config.cfg\nindex 2775cba87c9..576a3872d29 100644\n--- a/src/sqlfluff/core/default_config.cfg\n+++ b/src/sqlfluff... | [
{
"diff_hunk": "@@ -0,0 +1,92 @@\n+\"\"\"Implementation of Rule L062.\"\"\"\n+\n+from typing import Optional\n+\n+from sqlfluff.core.rules.base import BaseRule, LintResult, RuleContext\n+from sqlfluff.core.rules.doc_decorators import document_configuration\n+\n+\n+@document_configuration\n+class Rule_L062(BaseR... | fd302356c450e2efc8eebae4d872da835caea034 | diff --git a/src/sqlfluff/core/default_config.cfg b/src/sqlfluff/core/default_config.cfg
index 2775cba87c9..8a9c5c91960 100644
--- a/src/sqlfluff/core/default_config.cfg
+++ b/src/sqlfluff/core/default_config.cfg
@@ -143,3 +143,7 @@ unquoted_identifiers_policy = all
quoted_identifiers_policy = all
allow_space_in_iden... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} |
saltstack__salt-62635@e3dae00 | saltstack/salt | Python | 62,635 | Fix renderers not getting the correct salt functions | ### What does this PR do?
Gives the renderers access to the correct function sets via the wrapper that is passed in.
**_NOTE: This reverts the fix from https://github.com/saltstack/salt/pull/61634, but this is definitely a bigger issue._**
### What issues does this PR fix or reference?
Fixes: https://github.com... | 2022-09-08T02:16:37Z | [BUG] 3005 breaks user.info in state files when using salt-ssh
**Description**
we use the `user.info` execution module to find a user's home dir in a lot of templates. it appears to be broken in v3005:
```
[ERROR ] Rendering exception occurred
Traceback (most recent call last):
File "/home/tessa/.local/share/v... | i do not seem to be able to recreate the issue. can you log into one of the machines you are having the issue on and run user.info through salt-call with -l debug and see if there is something blocking it from loading?
```
root@salt00:/srv/salt/tests# salt -C 'home* or salt00* or ipa* or media*' slsutil.renderer s... | [
{
"body": "**Description**\r\nwe use the `user.info` execution module to find a user's home dir in a lot of templates. it appears to be broken in v3005:\r\n```\r\n[ERROR ] Rendering exception occurred\r\nTraceback (most recent call last):\r\n File \"/home/tessa/.local/share/virtualenvs/salt-MPl0_fNV/lib/pyth... | 5458374eb14601451bd737cf01ba8ecc68731a50 | {
"head_commit": "e3dae0082c5b0d1f2599810e16059aa1ed88e195",
"head_commit_message": "make sure wrapper isn't None first :)",
"patch_to_review": "diff --git a/changelog/62610.fixed b/changelog/62610.fixed\nnew file mode 100644\nindex 000000000000..54c8bee35718\n--- /dev/null\n+++ b/changelog/62610.fixed\n@@ -0,0 +... | [
{
"diff_hunk": "@@ -41,13 +41,15 @@ def load_modules(self, data=None, proxy=None):\n Load up the modules for remote compilation via ssh\n \"\"\"\n self.functions = salt.loader.ssh_wrapper(self.opts, None, context=self.context)\n+ if self.wrapper is not None:\n+ self.wra... | 42c161ca260fc14ee3b2931b041bb4a3d7ab8abf | diff --git a/changelog/62610.fixed b/changelog/62610.fixed
new file mode 100644
index 000000000000..54c8bee35718
--- /dev/null
+++ b/changelog/62610.fixed
@@ -0,0 +1 @@
+Renderers now have access to the correct set of salt functions.
\ No newline at end of file
diff --git a/changelog/62620.fixed b/changelog/62620.fixed... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
sqlfluff__sqlfluff-2542@abbe104 | sqlfluff/sqlfluff | Python | 2,542 | Rules documentation improvements | <!--Thanks for adding this feature!-->
<!--Please give the Pull Request a meaningful title for the release notes-->
### Brief summary of the change made
<!--Please include `fixes #XXXX` to automatically close any corresponding issue when the pull request is merged. Alternatively if not fully closed you can say `... | 2022-02-02T13:13:45Z | Rules whose docs need rationales (or improvements to existing ones)
A few rules seem to lack a clear rationale or explanation why they are part of SQLFluff or why SQLFluff considers them "recommended practices". It's important to be clear, because if someone finds a rule annoying, they may want to just disable it. That... | [
{
"body": "A few rules seem to lack a clear rationale or explanation why they are part of SQLFluff or why SQLFluff considers them \"recommended practices\". It's important to be clear, because if someone finds a rule annoying, they may want to just disable it. That's fine if they understand the pros and cons of... | 8e51ac07ed4e4fb65b09e878f98ffd0c2b2cf323 | {
"head_commit": "abbe104a1041d598979b3b09fd0744fc7151695e",
"head_commit_message": "Remove unnecessary comment",
"patch_to_review": "diff --git a/docs/source/rules.rst b/docs/source/rules.rst\nindex 7cfd3f71d62..29b050c891f 100644\n--- a/docs/source/rules.rst\n+++ b/docs/source/rules.rst\n@@ -38,7 +38,14 @@ igno... | [
{
"diff_hunk": "@@ -37,9 +37,10 @@ class Rule_L014(Rule_L010):\n \n The functionality for this rule is inherited from :obj:`Rule_L010`.",
"line": null,
"original_line": 38,
"original_start_line": null,
"path": "src/sqlfluff/rules/L014.py",
"start_line": null,
"text": "@user1:\nI wond... | 439e7d703a23ba5ade8974881f97d9cef2537cec | diff --git a/docs/source/inthewild.rst b/docs/source/inthewild.rst
index df88a4bdcc7..50f740a0be0 100644
--- a/docs/source/inthewild.rst
+++ b/docs/source/inthewild.rst
@@ -53,4 +53,4 @@ Just add a section below by raising a PR on GitHub by
`GitHub Actions workflow <https://github.com/sqlfluff/sqlfluff-github-action... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Documentation Updates"
} | |
sqlfluff__sqlfluff-2537@eabd2e7 | sqlfluff/sqlfluff | Python | 2,537 | Allow L059 to be configured to always prefer quoted identifiers | ### Brief summary of the change made
fixes #2527 by providing a configuration option on the L059 rule.
### Are there any other side effects of this change that we should be aware of?
No side effects expected as the default values for the newly added configuration are respecting the previous L059 behavior.
### P... | 2022-02-01T12:32:15Z | L059: Allow prefered quoted for identifiers
The current rule L059 is raising an error when some unnecessary quoted identifier has been detected.
Although it is not recommended to quote identifiers when it's not needed, this is a convention I am using for automatic business script that are parsing my SQLs. Therefore,... | Sounds OK, though not sure of priority (unless you want to work on this?).
One thing to be careful off is for mixed quotes (who would use these?!?).
For example you have an identifier called "barry's comments" and a `preferred_quote_identifier` of single quotes. What should happen in this case? Leave as is? Or ca... | [
{
"body": "The current rule L059 is raising an error when some unnecessary quoted identifier has been detected.\r\n\r\nAlthough it is not recommended to quote identifiers when it's not needed, this is a convention I am using for automatic business script that are parsing my SQLs. Therefore, I would like to use ... | b1facf15a542239c7f445e02ded60db471abf93c | {
"head_commit": "eabd2e7f180612da6643022d2c48f189b90a85c9",
"head_commit_message": "Fix unit tests for L059\n\nFix tests as default dialect is ansi and backticks are not parsed. Added bigquery dialect tests to ensure this is working also with backticks when dialect is supporting them.",
"patch_to_review": "diff ... | [
{
"diff_hunk": "@@ -28,14 +38,63 @@ class Rule_L059(BaseRule):\n \n SELECT 123 as foo\n \n+ When ``force_quote_identifier = True``, the quotes are always necessary, no\n+ matter if the identifier is valid, a reserved keyword, or contains special\n+ characters.\n+\n+ | **Anti-pattern**\n+ ... | 958e3221f51397c1c2a4dc674cbcfdfeb8756a19 | diff --git a/src/sqlfluff/core/default_config.cfg b/src/sqlfluff/core/default_config.cfg
index 8a9c5c91960..7cdae4ad7d7 100644
--- a/src/sqlfluff/core/default_config.cfg
+++ b/src/sqlfluff/core/default_config.cfg
@@ -144,6 +144,10 @@ quoted_identifiers_policy = all
allow_space_in_identifier = False
additional_allowed... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} |
scikit-learn__scikit-learn-21552@cc1022e | scikit-learn/scikit-learn | Python | 21,552 | Support cross 32bit/64bit pickles for decision tree | #### Reference Issues/PRs
Fix #19602.
#### What does this implement/fix? Explain your changes.
This makes it possible to save a decision tree pickle on a 64bit machine and load it on a 32bit machine (as well as the other way around although this is probably not that useful in practice).
The test uses a simi... | 2021-11-04T10:46:55Z | Tree pickle portability between 64bit and 32bit arch
`Decision Tree Classifier`
```
C:\Users\Aryan\Desktop\heart-host>python app.py
C:\Users\Aryan\AppData\Local\Programs\Python\Python38-32\lib\site-packages\sklearn\utils\deprecation.py:144: FutureWarning: The sklearn.tree.tree module is deprecated in version 0.22... | Are you running the same version scikit-learn than the one used to create the `pkl`?
sklearn version : 0.22.2
YES
Could you as well give information about the OS and CPU architecture where the model was trained and where it is deployed?
From the type error, one could guess that the model was pickled with Python 32 bit... | [
{
"body": "`Decision Tree Classifier`\r\n\r\n```\r\nC:\\Users\\Aryan\\Desktop\\heart-host>python app.py\r\nC:\\Users\\Aryan\\AppData\\Local\\Programs\\Python\\Python38-32\\lib\\site-packages\\sklearn\\utils\\deprecation.py:144: FutureWarning: The sklearn.tree.tree module is deprecated in version 0.22 and will ... | 6cdffd860c49d30d3b9fa72c5fc1174e8eeaa35e | {
"head_commit": "cc1022ebd664b3891b7892fef7ebb7e75075ed7e",
"head_commit_message": "Remove skipif since joblib < 1.1 loading in non-native endianness is now handled by astype in __cinit__",
"patch_to_review": "diff --git a/doc/whats_new/v1.1.rst b/doc/whats_new/v1.1.rst\nindex 02982538ddd59..c478159523747 100644... | [
{
"diff_hunk": "@@ -645,17 +658,29 @@ cdef class Tree:\n self.max_n_classes)\n \n if (node_ndarray.dtype != NODE_DTYPE):\n- # possible mismatch of big/little endian due to serialization\n- # on a different architecture. Try swapping the byte order. \n- ... | ca1b0563fc7d6c8a865ed8330edc9a43bd3b09cf | diff --git a/doc/whats_new/v1.1.rst b/doc/whats_new/v1.1.rst
index cc607aedb3946..c0a89486039e8 100644
--- a/doc/whats_new/v1.1.rst
+++ b/doc/whats_new/v1.1.rst
@@ -231,6 +231,14 @@ Changelog
:class:`~sklearn.random_projection.SparseRandomProjection`. :pr:`21330` by
:user:`Loïc Estève <lesteve>`.
+:mod:`sklearn... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Bug Fixes"
} |
scikit-learn__scikit-learn-21701@b107078 | scikit-learn/scikit-learn | Python | 21,701 | ENH Add inverse_transform to random projection transformers | #### Reference Issues/PRs
Fixes #21687
#### What does this implement/fix? Explain your changes.
Adds a `fit_inverse_transform` parameter to all transformers in the `sklearn.random_projection` module: `GaussianRandomProjection` and `SparseRandomProjection`. When set to `True`, the pseudo-inverse of the compone... | 2021-11-17T22:42:33Z | Add inverse_transform() to random projection classes
### Describe the workflow you want to enable
`GaussianRandomProjection` and `SparseRandomProjection` should have an `inverse_transform()` method.
### Describe your proposed solution
Simply add the `inverse_transform()` method, with the appropriate input vali... | As computing the inverse is costly, it probably should be done in the `fit()` method, instead of every time we call `inverse_transform()`. But since it's not needed that often, I guess it should only be computed if an `inverse` hyperparameter is set to `True` (and the default would be `False`).
I guess `np.linalg.pinv(... | [
{
"body": "### Describe the workflow you want to enable\r\n\r\n`GaussianRandomProjection` and `SparseRandomProjection` should have an `inverse_transform()` method.\r\n\r\n### Describe your proposed solution\r\n\r\nSimply add the `inverse_transform()` method, with the appropriate input validation and tests, and ... | a794c58692a1f3e7a85a42d8c7f7ddd5fcf18baa | {
"head_commit": "b107078a18fc737685f0e2288e783f8cc0d62450",
"head_commit_message": "Add missing newline in test",
"patch_to_review": "diff --git a/doc/whats_new/v1.1.rst b/doc/whats_new/v1.1.rst\nindex cc607aedb3946..84de13fc09f4d 100644\n--- a/doc/whats_new/v1.1.rst\n+++ b/doc/whats_new/v1.1.rst\n@@ -231,6 +231... | [
{
"diff_hunk": "@@ -395,6 +403,12 @@ def fit(self, X, y=None):\n \" not the proper shape.\"\n )\n \n+ if self.fit_inverse_transform:\n+ components = self.components_\n+ if sp.issparse(components):\n+ components = components.toarray()",
"line": ... | ff1b1da3609a6f7201b9612e23381701614da421 | diff --git a/doc/modules/random_projection.rst b/doc/modules/random_projection.rst
index adb2d53bd14d6..7d3341f0244bb 100644
--- a/doc/modules/random_projection.rst
+++ b/doc/modules/random_projection.rst
@@ -160,3 +160,42 @@ projection transformer::
In Proceedings of the 12th ACM SIGKDD international conference on... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "New Feature Additions"
} |
scikit-learn__scikit-learn-21445@d4b5899 | scikit-learn/scikit-learn | Python | 21,445 | ENH add parameter subsample to KBinsDiscretizer | Reference Issues/PRs
Takes over the stalled #20397 and #17221 and closes #12492
What does this implement/fix? Explain your changes.
Adds a subsampling strategy to KBinsDiscretizer | 2021-10-24T10:42:23Z | KBinsDiscretizer(strategy='quantile') should subsample the training data when n_samples > 1e5
For large `n_samples` the univariate CDFs estimated on a large enough subsample should be accurate enough and it should protect us from the n log(n) complexity of sorting each column.
We already do that in `QuantileTransfor... | Shall I take this ?
Sure go ahead !
Hmmm... What obligation do we have to backwards compatibility?
> Hmmm... What obligation do we have to backwards compatibility?
I proposed to use the traditional `FutureWarning` strategy in the review of #12501.
@amueller @ogrisel @TomDLT is this still needed? If so, I could w... | [
{
"body": "For large `n_samples` the univariate CDFs estimated on a large enough subsample should be accurate enough and it should protect us from the n log(n) complexity of sorting each column.\r\n\r\nWe already do that in `QuantileTransformer`.\r\n\r\nMaybe we should also do that for `strategy='kmeans'`.",
... | 1f8825c8dd6238355191e3d1c98f4e4d54cfbf16 | {
"head_commit": "d4b58999b380ccd46f53db09a814b2aa5b4bc661",
"head_commit_message": "remove subsample=None",
"patch_to_review": "diff --git a/doc/whats_new/v1.1.rst b/doc/whats_new/v1.1.rst\nindex 7141080afbc06..24fe7f968d305 100644\n--- a/doc/whats_new/v1.1.rst\n+++ b/doc/whats_new/v1.1.rst\n@@ -88,6 +88,14 @@ C... | [
{
"diff_hunk": "@@ -174,6 +202,44 @@ def fit(self, X, y=None):\n \" instead.\"\n )\n \n+ n_samples, n_features = X.shape\n+\n+ if self.strategy == \"quantile\" and self.subsample is not None:\n+ if self.subsample == \"warn\":\n+ if X.shape[0] >... | ca56f8ba5306d654e268ad160ac1ce079d8e5acf | diff --git a/doc/whats_new/v1.1.rst b/doc/whats_new/v1.1.rst
index 542636b1642f7..7036139bfb10e 100644
--- a/doc/whats_new/v1.1.rst
+++ b/doc/whats_new/v1.1.rst
@@ -134,6 +134,11 @@ Changelog
:mod:`sklearn.preprocessing`
............................
+- |Enhancement| Adds a `subsample` parameter to :class:`preproces... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Performance Optimizations"
} |
saltstack__salt-62868@d1b540d | saltstack/salt | Python | 62,868 | Add onchange configuration for script engine | ### What does this PR do?
Adds configuration for the script engine to only fire an event if the event tag-specific data changes compared to the last run (see the linked issue).
### What issues does this PR fix or reference?
Fixes: https://github.com/saltstack/salt/issues/62867
### Previous Behavior
Fires an ev... | 2022-10-12T10:25:35Z | [FEATURE REQUEST] salt.engines.script: only fire event on data change
**Is your feature request related to a problem? Please describe.**
I wrote a script that derives data from an interface IP address and use the script engine to monitor its output. Only when the event data changes (on IP address change), I would like... | [
{
"body": "**Is your feature request related to a problem? Please describe.**\r\nI wrote a script that derives data from an interface IP address and use the script engine to monitor its output. Only when the event data changes (on IP address change), I would like to initiate a reaction.\r\n\r\n**Describe the so... | 5b08153a63a60de9faaed8ae100fed2c261ee767 | {
"head_commit": "d1b540dbda8d1a7f1b513fbab53f6cfdb7c7301c",
"head_commit_message": "Add more tests for script engine",
"patch_to_review": "diff --git a/changelog/62867.added b/changelog/62867.added\nnew file mode 100644\nindex 000000000000..fd9ad1d278a0\n--- /dev/null\n+++ b/changelog/62867.added\n@@ -0,0 +1 @@\... | [
{
"diff_hunk": "@@ -132,3 +150,8 @@ def start(cmd, output=\"json\", interval=1):\n proc.terminate()\n \n time.sleep(interval)\n+\n+\n+# helper to test the start function\n+def _running():",
"line": null,
"original_line": 156,
"original_start_line": null,
"path": "salt/eng... | 926730560d290d62b8e79ad600271c9597b1752e | diff --git a/changelog/62867.added b/changelog/62867.added
new file mode 100644
index 000000000000..fd9ad1d278a0
--- /dev/null
+++ b/changelog/62867.added
@@ -0,0 +1 @@
+Added onchange configuration for script engine
diff --git a/salt/engines/script.py b/salt/engines/script.py
index 15628753d31b..67277b14d5fc 100644
--... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} | |
scikit-learn__scikit-learn-21389@dc82d4f | scikit-learn/scikit-learn | Python | 21,389 | FIX delete feature_names_in_ when refitting on a ndarray | Fixes #21383
| 2021-10-21T14:28:48Z | feature_names_in_ is not reset after calling fit() again with a NumPy array
### Describe the bug
In Scikit-Learn 1.0.0, if you fit a `OneHotEncoder` with a Pandas DataFrame, it records the feature names in `feature_names_in_`. Great! But if you fit it again with a NumPy array, the old feature names are not removed, ev... | Thanks for the report. I think it would be great to include a fix for this in 1.0.1 but I let @jeremiedbb and @glemaitre decide since they volunteered to be release managers for 1.0.1.
take
Yep it makes sense to solve it. A common test (at least with the mocking transformer would be nice). | [
{
"body": "### Describe the bug\n\nIn Scikit-Learn 1.0.0, if you fit a `OneHotEncoder` with a Pandas DataFrame, it records the feature names in `feature_names_in_`. Great! But if you fit it again with a NumPy array, the old feature names are not removed, even when the number of features in the NumPy array does ... | d5db19718a6bf2b6e10fd7a7d706d6131e80f84b | {
"head_commit": "dc82d4fd7c7a2e0abb84e5e6d820b6bcb8bee62d",
"head_commit_message": "remove double validation",
"patch_to_review": "diff --git a/doc/whats_new/v1.0.rst b/doc/whats_new/v1.0.rst\nindex c27565bc3968d..e043d21e538f6 100644\n--- a/doc/whats_new/v1.0.rst\n+++ b/doc/whats_new/v1.0.rst\n@@ -99,6 +99,14 @... | [
{
"diff_hunk": "@@ -3732,7 +3732,6 @@ def check_dataframe_column_names_consistency(name, estimator_orig):\n set_random_state(estimator)\n \n X_orig = rng.normal(size=(150, 8))\n-",
"line": null,
"original_line": 3735,
"original_start_line": null,
"path": "sklearn/utils/estimator_checks.p... | fc443094224eb83fc62b8a2d2cde2fc0c4ba3ca5 | diff --git a/doc/whats_new/v1.0.rst b/doc/whats_new/v1.0.rst
index c27565bc3968d..e043d21e538f6 100644
--- a/doc/whats_new/v1.0.rst
+++ b/doc/whats_new/v1.0.rst
@@ -99,6 +99,14 @@ Fixed models
where the underlying check for an attribute did not work with NumPy arrays.
:pr:`21145` by :user:`Zahlii <Zahlii>`.
+Mi... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
saltstack__salt-62404@b1ae332 | saltstack/salt | Python | 62,404 | netmiko poxy import fixes | ### What does this PR do?
Due to changes in the Netmiko library for the exception paths, need to check the version of Netmiko python library and then import the exceptions from different locations depending on the result.
### What issues does this PR fix or reference?
Fixes: #62405
### Merge requirements satis... | 2022-08-01T21:51:21Z | [BUG] netmiko proxy exception depending on version installed
**Description**
If a user attempts to use the Netmiko proxy minion with the version of Netmiko Python library higher than 3.4.0 then an exception is caused and the proxy minion is unable to load.
```
[DEBUG ] Failed to import proxy netmiko_px:
Traceba... | [
{
"body": "**Description**\r\nIf a user attempts to use the Netmiko proxy minion with the version of Netmiko Python library higher than 3.4.0 then an exception is caused and the proxy minion is unable to load.\r\n\r\n```\r\n[DEBUG ] Failed to import proxy netmiko_px:\r\nTraceback (most recent call last):\r\n ... | 77be876be32ae9c7568c035a8ec191abd8b88bb8 | {
"head_commit": "b1ae332650b054dfac4c27b34a8164e1216947e8",
"head_commit_message": "Adding changelog.",
"patch_to_review": "diff --git a/changelog/62405.fixed b/changelog/62405.fixed\nnew file mode 100644\nindex 000000000000..a8077992fe1e\n--- /dev/null\n+++ b/changelog/62405.fixed\n@@ -0,0 +1 @@\n+Due to change... | [
{
"diff_hunk": "@@ -187,13 +187,19 @@\n import time\n \n import salt.utils.args\n+from salt.utils.versions import LooseVersion as _LooseVersion\n \n try:\n from netmiko import ConnectHandler\n- from netmiko.ssh_exception import (\n- NetMikoAuthenticationException,\n- NetMikoTimeoutException... | c0157fc90edd5a6cafc3ac50180231bf04574324 | diff --git a/changelog/62405.fixed b/changelog/62405.fixed
new file mode 100644
index 000000000000..a8077992fe1e
--- /dev/null
+++ b/changelog/62405.fixed
@@ -0,0 +1 @@
+Due to changes in the Netmiko library for the exception paths, need to check the version of Netmiko python library and then import the exceptions from... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} | |
saltstack__salt-62340@41ffa5d | saltstack/salt | Python | 62,340 | add minion swarm test using saltfactories | ### What does this PR do?
Adds some simple tests against a swarm of 20 minions.
### What issues does this PR fix or reference?
Fixes: https://github.com/saltstack/salt/issues/61104
### Merge requirements satisfied?
**[NOTICE] Bug fixes or features added to Salt require tests.**
<!-- Please review the [test do... | 2022-07-18T20:43:39Z | [TECH DEBT] Add minionswarm tests to the test suite.
Add minionswarm tests to the test suite.
Minionswarm.py is located in the tests directory in the salt repo.
when running this command manually `python3 minionswarm.py -m 20 --master localhost`, keys get generated. Then accept the keys and run commands. All 20 m... | [
{
"body": "Add minionswarm tests to the test suite.\r\n\r\nMinionswarm.py is located in the tests directory in the salt repo.\r\n\r\nwhen running this command manually `python3 minionswarm.py -m 20 --master localhost`, keys get generated. Then accept the keys and run commands. All 20 minions need to report back... | 559eadbfea54ff759234e199b0e64e04fc6d4bf2 | {
"head_commit": "41ffa5d3e4732844c4c7c2b9a2f4afc3d50ed152",
"head_commit_message": "remove f string for debian 9",
"patch_to_review": "diff --git a/tests/minionswarm.py b/tests/minionswarm.py\ndeleted file mode 100644\nindex cb3cb0aa38db..000000000000\n--- a/tests/minionswarm.py\n+++ /dev/null\n@@ -1,438 +0,0 @@... | [
{
"diff_hunk": "@@ -0,0 +1,63 @@\n+from contextlib import ExitStack\n+\n+import pytest\n+from saltfactories.utils import random_string\n+\n+\n+@pytest.fixture(scope=\"package\")\n+def salt_master_factory(salt_factories):\n+ factory = salt_factories.salt_master_daemon(\n+ random_string(\"swarm-master-\... | adf29b7205d82a23c7ce72ca31ebe9dfe066eafc | diff --git a/tests/minionswarm.py b/tests/minionswarm.py
deleted file mode 100644
index cb3cb0aa38db..000000000000
--- a/tests/minionswarm.py
+++ /dev/null
@@ -1,438 +0,0 @@
-#!/usr/bin/env python
-
-"""
-The minionswarm script will start a group of salt minions with different ids
-on a single system to test scale capa... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Test Suite / CI Enhancements"
} | |
sqlfluff__sqlfluff-2510@8c37232 | sqlfluff/sqlfluff | Python | 2,510 | Refactor date part functions | <!--Thanks for adding this feature!-->
<!--Please give the Pull Request a meaningful title for the release notes-->
### Brief summary of the change made
<!--Please include `fixes #XXXX` to automatically close any corresponding issue when the pull request is merged. Alternatively if not fully closed you can say `... | 2022-01-29T23:18:11Z | L010: SQLFluff 0.9.1 (and later) capitalize columns named year/month when used as the second parameters in PARSE_DATE
## Expected Behaviour
When run on a SQL file containing a line like PARSE_DATE("%Y", year), SQLFluff should realize that year must be a variable rather than an SQL keyword this context and not request ... | Here's the output of _sqlfluff parse_:
```
[L: 1, P: 1] |file:
[L: 1, P: 1] | statement:
[L: 1, P: 1] | select_statement:
[L: 1, P: 1] | select_clause:
[L: 1, P: 1] | keyword: 'SELECT'
[L: 1, P: 7] ... | [
{
"body": "## Expected Behaviour\r\nWhen run on a SQL file containing a line like PARSE_DATE(\"%Y\", year), SQLFluff should realize that year must be a variable rather than an SQL keyword this context and not request that it is capitalized.\r\n\r\n## Observed Behavior\r\nFor this function year and month is trea... | e072a98e3888ae46023ab01e272363bd5336b3e9 | {
"head_commit": "8c37232f68e324bcad9dee1df25e821307cf6c0c",
"head_commit_message": "More cleanup",
"patch_to_review": "diff --git a/requirements_dev.txt b/requirements_dev.txt\nindex 7d2dac0a33a..5e13a794501 100644\n--- a/requirements_dev.txt\n+++ b/requirements_dev.txt\n@@ -2,7 +2,8 @@\n # code linting and form... | [
{
"diff_hunk": "@@ -1907,6 +1912,9 @@ class FunctionSegment(BaseSegment):\n type = \"function\"\n match_grammar = OneOf(\n Sequence(\n+ # Treat fucnctions which take date parts separately",
"line": null,
"original_line": 1915,
"original_start_line": null,
"path": "src/... | 955ebe1a99214ec3db9f699eb068a1260d638a7e | diff --git a/src/sqlfluff/dialects/dialect_ansi.py b/src/sqlfluff/dialects/dialect_ansi.py
index 531cc66b925..a994276dbb7 100644
--- a/src/sqlfluff/dialects/dialect_ansi.py
+++ b/src/sqlfluff/dialects/dialect_ansi.py
@@ -164,6 +164,8 @@
]
)
+ansi_dialect.sets("date_part_function_name").update(["DATEADD"])
+
# ... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Code Style, Linting, Formatting Fixes"
} |
scikit-learn__scikit-learn-21497@bc82f43 | scikit-learn/scikit-learn | Python | 21,497 | CI Adds quicker CI failure to reduce resource usage | <!--
Thanks for contributing a pull request! Please ensure you have taken a look at
the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md
-->
#### Reference Issues/PRs
<!--
Example: Fixes #1234. See also #3456.
Please use keywords (e.g., Fixes) to create link to th... | 2021-10-29T03:36:56Z | Quicker Failing CI with reduced resource usage
Here is an idea to reduce our Azure Pipelines CI usage while trying to make it give informative feedback as possible in case of typos committed in PRs.
The suggestion would be to change the Azure Pipelines config to have 2 top level jobs:
- 1 linux quick-failing buil... | I like this approach overall.
> The downside it that when one expects the PR to be green, the total time will be "first test run + longest test run of the remainder" instead of just "linter time + longest test run" as is the case now with more parallelism.
We can have another commit tag `[azure all-parallel]`, to... | [
{
"body": "Here is an idea to reduce our Azure Pipelines CI usage while trying to make it give informative feedback as possible in case of typos committed in PRs.\r\n\r\nThe suggestion would be to change the Azure Pipelines config to have 2 top level jobs:\r\n\r\n- 1 linux quick-failing build that runs the test... | d52e946fa4fca4282b0065ddcb0dd5d268c956e7 | {
"head_commit": "bc82f43cf357b4a6c9a3d5eb586618ce81a5702c",
"head_commit_message": "Merge remote-tracking branch 'upstream/main' into ci_failing_faster",
"patch_to_review": "diff --git a/azure-pipelines.yml b/azure-pipelines.yml\nindex 1c9339308a45a..c4b2e2fcf1028 100644\n--- a/azure-pipelines.yml\n+++ b/azure-p... | [
{
"diff_hunk": "@@ -0,0 +1,39 @@\n+parameters:\n+ name: ''\n+ vmImage: ''\n+ matrix: []\n+ dependsOn: []\n+ dependsOnParallel: []\n+ condition: ''\n+ commitMessage: ''\n+\n+jobs:\n+# When [azure parallel] is *not* in the commit message, this build is enabled.\n+# Later builds should check if this job suc... | 39dd70d53ba71c9f22ff25a5d08f1023c8955ace | diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index 3f6b96dff9f60..7cb800fc63389 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -146,7 +146,12 @@ jobs:
SKLEARN_TESTS_GLOBAL_RANDOM_SEED: '42' # default global random seed
# Check compilation with Ubuntu 22.04 LTS (Jammy Jellyfish) and... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Test Suite / CI Enhancements"
} |
scikit-learn__scikit-learn-21408@fa626fb | scikit-learn/scikit-learn | Python | 21,408 | [MRG] Expose `n_iter_` to BaseLibSVM | #### Reference Issues/PRs
Fixes #18928
#### What does this implement/fix? Explain your changes.
This PR exposes `n_iter_` to [BaseLibSVM](https://github.com/scikit-learn/scikit-learn/blob/d4d5f8c7e02cfaced76757fbf38e21c5b28b67b0/sklearn/svm/_base.py#L63):
- Add private attribute `_num_iter` to BaseLibSVM. This... | 2021-10-22T15:57:37Z | Get the number of iterations in SVR
#### Describe the workflow you want to enable
Hi everyone,
I am manipulating `SVR` objects in `GridSearcheCV`. I am able to access the `mean_fit_time` in the `cv_results_`, but I can't access the number of iterations of the optimization problem.
I would like to have this infor... | I don't know why we don't expose `n_iter` (it's possible that LibSVM makes it hard for us).
Regarding GridSearch: attributes aren't stored in `cv_results`. We can't store fitted models there because that would mean storing `n_param_candidates` * `n_folds` models, which can be prohibitively expensive in terms of memo... | [
{
"body": "#### Describe the workflow you want to enable\r\nHi everyone,\r\n\r\nI am manipulating `SVR` objects in `GridSearcheCV`. I am able to access the `mean_fit_time` in the `cv_results_`, but I can't access the number of iterations of the optimization problem.\r\n\r\nI would like to have this information ... | 39782b71b03d180bb2fe2ac321b6bab87a43746a | {
"head_commit": "fa626fb737185f37f7105d2cfa1595f00bb383ef",
"head_commit_message": "Comment unpacking and repacking of values for test\n\nCo-authored-by: Julien Jerphanion <git@jjerphan.xyz>",
"patch_to_review": "diff --git a/doc/whats_new/v1.1.rst b/doc/whats_new/v1.1.rst\nindex 2cf9d9226dbff..66e0e7c6610a0 100... | [
{
"diff_hunk": "@@ -3268,9 +3264,16 @@ def check_non_transformer_estimators_n_iter(name, estimator_orig):\n \n set_random_state(estimator, 0)\n \n+ if name in [\"SVC\", \"NuSVC\"] and estimator.kernel == \"precomputed\":\n+ X = np.dot(X, X.T)",
"line": null,
"original_line": 32... | ff3fabded6062af33199f5486e7baf7869b6d322 | diff --git a/doc/whats_new/v1.1.rst b/doc/whats_new/v1.1.rst
index 37dc4c56dc860..1438b96a8295a 100644
--- a/doc/whats_new/v1.1.rst
+++ b/doc/whats_new/v1.1.rst
@@ -266,6 +266,13 @@ Changelog
Setting a transformer to "passthrough" will pass the features unchanged.
:pr:`20860` by :user:`Shubhraneel Pal <shubhranee... | {
"difficulty": "high",
"estimated_review_effort": 4,
"problem_domain": "New Feature Additions"
} |
scikit-learn__scikit-learn-21258@c505031 | scikit-learn/scikit-learn | Python | 21,258 | DOC Linear regression doc update | <!--
Thanks for contributing a pull request! Please ensure you have taken a look at
the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md
-->
#### Reference Issues/PRs
Fixes #21254.
Related to #14228.
#### What does this implement/fix? Explain your changes.
By f... | 2021-10-06T14:26:51Z | `n_jobs` parameter documentation in `LinearRegression`
### Describe the issue linked to the documentation
By fitting a `LinearRegression` the `n_jobs` parameter can set the number of threads only in case of `positive=True` or in case of `sp.issparse(X)`. In other cases the `linalg.lstsq` is called which can handle (M,... | I agree the documentation can be improved here. Would you like to update a PR and update the docstring?
Sure! | [
{
"body": "### Describe the issue linked to the documentation\n\nBy fitting a `LinearRegression` the `n_jobs` parameter can set the number of threads only in case of `positive=True` or in case of `sp.issparse(X)`. In other cases the `linalg.lstsq` is called which can handle (M, K) shaped `y` and there is no par... | 31c66a9c09e7f7d3de262cd5790de44608097850 | {
"head_commit": "c5050319f5bf66adbdfb49251ad1204b5399e79b",
"head_commit_message": "Apply suggestions from code review\n\nCo-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>",
"patch_to_review": "diff --git a/sklearn/linear_model/_base.py b/sklearn/linear_model/_base.py\nindex 8b5102ecdd403..8a8c43819292e 1006... | [
{
"diff_hunk": "@@ -536,10 +536,10 @@ class LinearRegression(MultiOutputMixin, RegressorMixin, LinearModel):\n \n n_jobs : int, default=None\n The number of jobs to use for the computation. This will only provide\n- speedup for n_targets > 1 and sufficient large problems.\n- ``None`` m... | 6b0916c83a2645e9c394cfd7e607f170be113648 | diff --git a/sklearn/linear_model/_base.py b/sklearn/linear_model/_base.py
index 8b5102ecdd403..6b94d6ecc4e49 100644
--- a/sklearn/linear_model/_base.py
+++ b/sklearn/linear_model/_base.py
@@ -536,10 +536,11 @@ class LinearRegression(MultiOutputMixin, RegressorMixin, LinearModel):
n_jobs : int, default=None
... | {
"difficulty": "low",
"estimated_review_effort": 2,
"problem_domain": "Documentation Updates"
} |
scikit-learn__scikit-learn-21199@b4a1240 | scikit-learn/scikit-learn | Python | 21,199 | FIX Non-fit methods no long raises UserWarning for valid dataframes | <!--
Thanks for contributing a pull request! Please ensure you have taken a look at
the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md
-->
#### Reference Issues/PRs
<!--
Example: Fixes #1234. See also #3456.
Please use keywords (e.g., Fixes) to create link to th... | 2021-09-29T19:48:57Z | False UserWarning for features names
### Describe the bug
Since the last stable update **(1.0)**, I get the following warning:
**C:\Users\...\venv\lib\site-packages\sklearn\base.py:441: UserWarning: X does not have valid feature names, but KNeighborsClassifier was fitted with feature names
warnings.warn(**
Chang... | The issue comes from the fact that we validate twice in the predict method. First at the beginning of this method and then in the kneighbors method. After the first validation, X is a ndarray and no longer has feature names. https://github.com/scikit-learn/scikit-learn/blob/9cb4e761f530e7a0708059b1312921753d056cbe/skle... | [
{
"body": "### Describe the bug\n\nSince the last stable update **(1.0)**, I get the following warning: \r\n**C:\\Users\\...\\venv\\lib\\site-packages\\sklearn\\base.py:441: UserWarning: X does not have valid feature names, but KNeighborsClassifier was fitted with feature names\r\n warnings.warn(**\r\nChanging... | 17a788da424da4fce5199c95e43258c0fb2ab5e2 | {
"head_commit": "b4a1240077ac686e65375adcfd815e701b6aaf1b",
"head_commit_message": "FIX Adds support for bsr and dok in precomputed",
"patch_to_review": "diff --git a/doc/whats_new/v1.0.rst b/doc/whats_new/v1.0.rst\nindex d8776653cd9e8..0a3c5462d7693 100644\n--- a/doc/whats_new/v1.0.rst\n+++ b/doc/whats_new/v1.0... | [
{
"diff_hunk": "@@ -186,7 +186,7 @@ def _check_precomputed(X):\n else:\n graph = X\n \n- if graph.format not in (\"csr\", \"csc\", \"coo\", \"lil\"):\n+ if graph.format not in (\"csr\", \"csc\", \"coo\", \"lil\", \"bsr\", \"dok\"):",
"line": null,
"original_line": 189,
"original_st... | 0104f63fcadae22607ef816971b620fab240663d | diff --git a/doc/whats_new/v1.0.rst b/doc/whats_new/v1.0.rst
index 4db2b097d2e75..5cac7e63e31fa 100644
--- a/doc/whats_new/v1.0.rst
+++ b/doc/whats_new/v1.0.rst
@@ -5,13 +5,23 @@
.. _changes_1_0_1:
Version 1.0.1
-=============
**In Development**
Changelog
---------
+Fixed models
+------------
+
+- |Fix| No... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
saltstack__salt-62274@b06c088 | saltstack/salt | Python | 62,274 | Fix localhost detection in glusterfs.peers | ### What does this PR do?
This fixes the detection of a localhost peer in cases where the host IP lookup returns a loopback address.
### What issues does this PR fix or reference?
Fixes: #62273
### Merge requirements satisfied?
**[NOTICE] Bug fixes or features added to Salt require tests.**
<!-- Please revi... | 2022-07-04T23:37:41Z | [BUG] Glusterfs `peered` doesn't understand loopback IP as localhost
**Description**
In some situations, `glusterfs.peered` fails to detect a peer as being localhost.
More concretely, in some cases `salt.utils.network.host_to_ips(name)` may return an address like `127.0.1.1`. This happens for instance if the host n... | Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey.
Please be sure to review our [Code... | [
{
"body": "**Description**\r\nIn some situations, `glusterfs.peered` fails to detect a peer as being localhost.\r\n\r\nMore concretely, in some cases `salt.utils.network.host_to_ips(name)` may return an address like `127.0.1.1`. This happens for instance if the host name is associated to a loopback address in `... | 5b2b6e826ca48671a8b6165407c1bcebe4add1f1 | {
"head_commit": "b06c088afc8463a0f6810b55fb97e28d4632c475",
"head_commit_message": "Merge branch 'master' into fix_glusterfs_peer_loopback",
"patch_to_review": "diff --git a/changelog/62273.fixed b/changelog/62273.fixed\nnew file mode 100644\nindex 000000000000..1f4caad60855\n--- /dev/null\n+++ b/changelog/62273... | [
{
"diff_hunk": "@@ -73,7 +73,8 @@ def peered(name):\n # it from the user.\n this_ips = set(salt.utils.network.ip_addrs())\n this_ips.update(salt.utils.network.ip_addrs6())\n- if this_ips.intersection(name_ips):\n+ if (any(salt.utils.network.is_loopback(addr) for addr in nam... | e60e063664be61d89b8f453050215df59ae81a6e | diff --git a/changelog/62273.fixed b/changelog/62273.fixed
new file mode 100644
index 000000000000..1f4caad60855
--- /dev/null
+++ b/changelog/62273.fixed
@@ -0,0 +1 @@
+Fix localhost detection in glusterfs.peers
diff --git a/salt/states/glusterfs.py b/salt/states/glusterfs.py
index be7374b03408..bfe4fb63380b 100644
--... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
saltstack__salt-62043@f52ad78 | saltstack/salt | Python | 62,043 | Fix Jinja template cache loading | ### What does this PR do?
This PR fixes an issue where Jinja templates can be loaded from the cache despite being removed from the Salt filesystem. See issue for more details.
### What issues does this PR fix or reference?
Fixes: #62042
### Previous Behavior
Salt would load cached Jinja templates if the files... | 2022-05-09T21:43:50Z | [BUG] removed Jinja templates can still be loaded from cache
**Description**
Found a bug where an included Jinja template can still be loaded from the cache despite being removed from the Salt filesystem.
**Setup**
Create two test files on the Salt filesystem:
```yaml
# /srv/salt/jinja_cache.sls
{% from "ji... | [
{
"body": "**Description**\r\nFound a bug where an included Jinja template can still be loaded from the cache despite being removed from the Salt filesystem.\r\n\r\n**Setup**\r\n\r\nCreate two test files on the Salt filesystem:\r\n\r\n```yaml\r\n# /srv/salt/jinja_cache.sls\r\n{% from \"jinja_cache.jinja\" impor... | 43e122a08d2e5782995f5f5399b9655f7bc7db5b | {
"head_commit": "f52ad78342eac700392d8c9cce75bd1d8f772821",
"head_commit_message": "fix jinja tests for opts logic",
"patch_to_review": "diff --git a/changelog/62042.fixed b/changelog/62042.fixed\nnew file mode 100644\nindex 000000000000..6107828cbe7a\n--- /dev/null\n+++ b/changelog/62042.fixed\n@@ -0,0 +1 @@\n+... | [
{
"diff_hunk": "@@ -165,6 +167,9 @@ def get_source(self, environment, template):\n template,\n )\n raise TemplateNotFound(template)\n+ # local file clients should pass the dot-expanded relative path\n+ if environment.globals.get(\"opts\",... | 83e10071c659c3801a3b385f94b88b724ef47e7f | diff --git a/changelog/62042.fixed b/changelog/62042.fixed
new file mode 100644
index 000000000000..6107828cbe7a
--- /dev/null
+++ b/changelog/62042.fixed
@@ -0,0 +1 @@
+Fix cache checking for Jinja templates
diff --git a/salt/utils/jinja.py b/salt/utils/jinja.py
index aa8ebe90546c..627697f5feed 100644
--- a/salt/utils... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} | |
saltstack__salt-61935@5e418be | saltstack/salt | Python | 61,935 | docker_network.present fix for 60316 | ### What does this PR do?
updates `com.docker.network.bridge.name` in comparison network so there isn't a conflict. and ignores the setting in the comparison.
### What issues does this PR fix or reference?
Fixes: #60316
### Merge requirements satisfied?
**[NOTICE] Bug fixes or features added to Salt require... | 2022-04-08T23:05:04Z | [BUG] docker_network.present error on subsequent run when using driver_opts
**Description**
I'm trying to set a bridge name name using `driver_opts` in the `docker_network.present` module. The network is created with the correct name when it does not exist. When it does exist, the state fails.
**Setup**
```
Creat... | @supfors thanks for the report. It looks like the state module is not handling the scenario when the network already exists when using a bridge name. | [
{
"body": "**Description**\r\nI'm trying to set a bridge name name using `driver_opts` in the `docker_network.present` module. The network is created with the correct name when it does not exist. When it does exist, the state fails.\r\n\r\n**Setup**\r\n```\r\nCreate mynet:\r\n docker_network.present:\r\n - ... | 1568067961d5867f14a3b9dd550d7712aba1b463 | {
"head_commit": "5e418bea1a027b47a172a70acf67bb989ec457d4",
"head_commit_message": "Merge branch 'master' into 60316",
"patch_to_review": "diff --git a/changelog/60316.fixed b/changelog/60316.fixed\nnew file mode 100644\nindex 000000000000..d1bb23e925a9\n--- /dev/null\n+++ b/changelog/60316.fixed\n@@ -0,0 +1 @@\... | [
{
"diff_hunk": "@@ -644,11 +644,21 @@ def present(\n # wouldng't know if the IPv4 subnet in the existing network was\n # explicitly configured or was automatically assigned by Docker.\n enable_ipv6 = kwargs.pop(\"enable_ipv6\", None)\n+ kwargs2 = kwargs",
"line... | 9a833e6600972642d3c32de5f629bc547fd0fadc | diff --git a/changelog/60316.fixed b/changelog/60316.fixed
new file mode 100644
index 000000000000..d1bb23e925a9
--- /dev/null
+++ b/changelog/60316.fixed
@@ -0,0 +1 @@
+fix docker_network.present when com.docker.network.bridge.name is being used as the unixes can not have a bridge of the same name
diff --git a/salt/mo... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
saltstack__salt-62326@487159b | saltstack/salt | Python | 62,326 | Fix #62281 |
### What does this PR do?
added if-else block to check the python version and fill repo_path with correct data regarding the python major version
### What issues does this PR fix or reference?
Fixes: #62281 | 2022-07-12T21:05:43Z | [BUG] module 'os' has no attribute 'getcwdu'
**Description**
Salt Package Manager (SPM) is using a deprecated Python method called `os.getcwdu()`, which used to exist in Python 2.x, but not anymore on Python 3.x. This causes the following exception when calling `spm create_repo .` on SPM version 3004:
```
[ERROR ... | Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey.
Please be sure to review our [Code... | [
{
"body": "**Description**\r\nSalt Package Manager (SPM) is using a deprecated Python method called `os.getcwdu()`, which used to exist in Python 2.x, but not anymore on Python 3.x. This causes the following exception when calling `spm create_repo .` on SPM version 3004:\r\n\r\n```\r\n[ERROR ] An un-handled e... | d7168f8a2c5392c4f10cf9a72f89145045f1a3e6 | {
"head_commit": "487159bd3633847281fd68921e711b578d8fdad2",
"head_commit_message": "Merge branch 'master' into master",
"patch_to_review": "diff --git a/salt/spm/__init__.py b/salt/spm/__init__.py\nindex d945baee2718..bc939b3c1885 100644\n--- a/salt/spm/__init__.py\n+++ b/salt/spm/__init__.py\n@@ -747,7 +747,9 @... | [
{
"diff_hunk": "@@ -747,7 +747,9 @@ def _create_repo(self, args):\n raise SPMInvocationError(\"A path to a directory must be specified\")\n \n if args[1] == \".\":\n- repo_path = os.getcwdu()\n+ repo_path = os.getcwd()\n+ if sys.version_info.major == 2:",
... | c89810962733d872b9afe6317538bda418e6d8f3 | diff --git a/changelog/62281.fixed b/changelog/62281.fixed
new file mode 100644
index 000000000000..60135ec42808
--- /dev/null
+++ b/changelog/62281.fixed
@@ -0,0 +1 @@
+Fix Salt Package Manager (SPM) exception when calling spm create_repo .
\ No newline at end of file
diff --git a/salt/spm/__init__.py b/salt/spm/__ini... | {
"difficulty": "low",
"estimated_review_effort": 2,
"problem_domain": "Bug Fixes"
} |
sqlfluff__sqlfluff-2455@775653c | sqlfluff/sqlfluff | Python | 2,455 | Exclude WINDOW clauses from L054 | <!--Firstly, thanks for adding this feature! Secondly, please check the key steps against the checklist below to make your contribution easy to merge.-->
<!--Please give the Pull Request a meaningful title (including the dialect this PR is for if it is dialect specific), as this will automatically be added to the re... | 2022-01-24T21:25:44Z | Remove WINDOW functions clauses from Rule L054
SQLFluff is saying I’m violating L054, cause I’ve got implicit ORDER BY clauses, but EXPLICIT ones inside ORDER BY of my WINDOW Functions. I'd suggest that Window functions clauses should be excluded from this rule since, although feasible, it's unnatural to use IMPLICIT ... | [
{
"body": "SQLFluff is saying I’m violating L054, cause I’ve got implicit ORDER BY clauses, but EXPLICIT ones inside ORDER BY of my WINDOW Functions. I'd suggest that Window functions clauses should be excluded from this rule since, although feasible, it's unnatural to use IMPLICIT clauses within them.\r\n\r\n`... | 64a79f69c69d40b864e98bfb9973c6ffadd5cd44 | {
"head_commit": "775653c127dfdfd6949d61ab5faa41db849a08f2",
"head_commit_message": "Revert accidently removed test case",
"patch_to_review": "diff --git a/src/sqlfluff/rules/L054.py b/src/sqlfluff/rules/L054.py\nindex a33ff246b5c..e8b7d7a9388 100644\n--- a/src/sqlfluff/rules/L054.py\n+++ b/src/sqlfluff/rules/L05... | [
{
"diff_hunk": "@@ -88,6 +91,11 @@ def _eval(self, context: RuleContext) -> Optional[LintResult]:\n if not context.segment.is_type(\"groupby_clause\", \"orderby_clause\"):\n return None\n \n+ # Ignore Windowing clauses\n+ for parent in context.parent_stack:",
"line": null,
... | 6d16a743bb817f09c093259b3d3ff5e6bf3cc5cd | diff --git a/src/sqlfluff/rules/L054.py b/src/sqlfluff/rules/L054.py
index a33ff246b5c..062e8ea4cf2 100644
--- a/src/sqlfluff/rules/L054.py
+++ b/src/sqlfluff/rules/L054.py
@@ -1,16 +1,19 @@
"""Implementation of Rule L054."""
-from typing import Optional
+from typing import Optional, List
from sqlfluff.core.rules.b... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Code Refactoring / Architectural Improvement"
} | |
sqlfluff__sqlfluff-2371@092fa21 | sqlfluff/sqlfluff | Python | 2,371 | Fix L026 false positive on "SELECT INTO" statement | <!--Firstly, thanks for adding this feature! Secondly, please check the key steps against the checklist below to make your contribution easy to merge.-->
<!--Please give the Pull Request a meaningful title (including the dialect this PR is for if it is dialect specific), as this will automatically be added to the re... | 2022-01-20T14:06:59Z | Exasol L026 - Fails on SELECT INTO TABLE statement
In Exasol we could insert data into a table like this:
```
select * into table schm.tab from schm.tab2;
```
## Expected Behaviour
Rule L026 should pass
## Observed Behaviour
Rule was raised
```
L: 2 | P: 21 | L026 | Reference 'schm.tab' refers to tabl... | This is a great first issue for anyone looking to contribute to SQLFluff: https://github.com/sqlfluff/sqlfluff/wiki/Contributing-Dialect-Changes
As noted by @jpy-git, this is a similar issue as #2265. There's an open PR for that issue (#2336). If we don't address it in that PR, it should be a pretty straightforward enh... | [
{
"body": "In Exasol we could insert data into a table like this:\r\n\r\n```\r\nselect * into table schm.tab from schm.tab2;\r\n```\r\n\r\n## Expected Behaviour\r\nRule L026 should pass\r\n\r\n## Observed Behaviour\r\nRule was raised\r\n```\r\nL: 2 | P: 21 | L026 | Reference 'schm.tab' refers to table/view n... | 849d0c128d0120c2e2dabdf5682cbfcbb769e5d6 | {
"head_commit": "092fa21b1d1fa928ff78e59daf07e79ee5227e71",
"head_commit_message": "Fix L026 false positive on Exasol \"SELECT INTO\" statement",
"patch_to_review": "diff --git a/src/sqlfluff/rules/L026.py b/src/sqlfluff/rules/L026.py\nindex 6bb12287743..b55a596824a 100644\n--- a/src/sqlfluff/rules/L026.py\n+++ ... | [
{
"diff_hunk": "@@ -122,19 +122,33 @@ def _analyze_table_references(\n # Try and resolve each reference to a value in query.aliases (or\n # in an ancestor query).\n for r in select_info.reference_buffer:\n- # This function walks up the query's p... | 4776c4b8b84f1ca8237d96de3d27c62d0003320c | diff --git a/src/sqlfluff/rules/L026.py b/src/sqlfluff/rules/L026.py
index 6bb12287743..8a470873635 100644
--- a/src/sqlfluff/rules/L026.py
+++ b/src/sqlfluff/rules/L026.py
@@ -122,12 +122,13 @@ def _analyze_table_references(
# Try and resolve each reference to a value in query.aliases (or
... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} |
sqlfluff__sqlfluff-2387@53b49f9 | sqlfluff/sqlfluff | Python | 2,387 | Jinja templater: Allow "load_macros_from_path" to be a comma-separated list of paths | <!--Firstly, thanks for adding this feature! Secondly, please check the key steps against the checklist below to make your contribution easy to merge.-->
<!--Please give the Pull Request a meaningful title (including the dialect this PR is for if it is dialect specific), as this will automatically be added to the re... | 2022-01-21T00:23:44Z | Are there plans to support Jinja `include` and `from` statements?
Currently, when trying to lint an sql file with one of these jinja statements:
```jinja
{% from 'my_macros.sql' import a_macro %}
```
or
```jinja
{% include 'file.sql' %}
```
it will fail with the message: "no loader for this environment speci... | @hdemers Did you find a way around this? This is the full error i get when running the lint command
"Unrecoverable failure in Jinja templating: no loader for
this environment specified. Have you configured your variables?
https://docs.sqlfluff.com/en/latest/configuration.html"
I've tried configuring the jinja ... | [
{
"body": "Currently, when trying to lint an sql file with one of these jinja statements:\r\n\r\n```jinja\r\n{% from 'my_macros.sql' import a_macro %}\r\n```\r\nor \r\n```jinja\r\n{% include 'file.sql' %}\r\n```\r\nit will fail with the message: \"no loader for this environment specified\".\r\n\r\nUnless I'm mi... | d903ff656552188e6a79d95ea9ebbda4e4ab87da | {
"head_commit": "53b49f9b6691ffb1b840f0b8cedf670f4b742a10",
"head_commit_message": "Merge branch 'main' into bhart-issue_829_multiple_directories_in_macro_path",
"patch_to_review": "diff --git a/docs/source/configuration.rst b/docs/source/configuration.rst\nindex d2faed4a143..329956c0533 100644\n--- a/docs/sourc... | [
{
"diff_hunk": "@@ -212,13 +214,16 @@ def _get_jinja_env(self, config=None):\n loader=FileSystemLoader(macros_path) if macros_path else None,\n )\n \n- def _get_macros_path(self, config):\n- macros_path = None\n+ def _get_macros_path(self, config: FluffConfig) -> Optional[List[s... | e914d3b5d4acccae43059d4a24beb4996731543b | diff --git a/docs/source/configuration.rst b/docs/source/configuration.rst
index d2faed4a143..329956c0533 100644
--- a/docs/source/configuration.rst
+++ b/docs/source/configuration.rst
@@ -402,34 +402,44 @@ this introduces the idea of config *blocks* which could be selectively
overwritten by other configuration files ... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} |
sqlfluff__sqlfluff-2364@baffe1e | sqlfluff/sqlfluff | Python | 2,364 | Exclude EMIT clauses from rule L013 | <!--Firstly, thanks for adding this feature! Secondly, please check the key steps against the checklist below to make your contribution easy to merge.-->
<!--Please give the Pull Request a meaningful title (including the dialect this PR is for if it is dialect specific), as this will automatically be added to the re... | 2022-01-20T11:39:23Z | EXASOL: L013 wrong result when using json_extract
<!--If this is a parsing or linting issue, please include a minimal SQL example which reproduces the issue, along with the `sqlfluff parse` output, `sqlfluff lint` output and `sqlfluff fix` output when relevant.-->
In Exasol we could use the `json_extract()` function... | [
{
"body": "<!--If this is a parsing or linting issue, please include a minimal SQL example which reproduces the issue, along with the `sqlfluff parse` output, `sqlfluff lint` output and `sqlfluff fix` output when relevant.-->\r\n\r\nIn Exasol we could use the `json_extract()` function to extract multiple values... | 731ee5a85c455cb199466e5662794645d00ca24a | {
"head_commit": "baffe1e1fab3d8f9344422fdac76d5cc7caddc98",
"head_commit_message": "More typos",
"patch_to_review": "diff --git a/src/sqlfluff/dialects/dialect_exasol.py b/src/sqlfluff/dialects/dialect_exasol.py\nindex 3c6c1e86c39..7cda7a1d41c 100644\n--- a/src/sqlfluff/dialects/dialect_exasol.py\n+++ b/src/sqlf... | [
{
"diff_hunk": "@@ -3770,3 +3766,17 @@ class FileSegment(BaseFileSegment):\n allow_trailing=True,\n ),\n )\n+\n+\n+@exasol_dialect.segment()\n+class EmitsGrammar(BaseFileSegment):\n+ \"\"\"EMITS Grammar for JSON_EXTRACT for example.",
"line": null,
"original_line": 3773,
"... | 9545768d318100a5793db7fdfd07e3e8092c1534 | diff --git a/src/sqlfluff/dialects/dialect_exasol.py b/src/sqlfluff/dialects/dialect_exasol.py
index 3c6c1e86c39..aa3175c4c38 100644
--- a/src/sqlfluff/dialects/dialect_exasol.py
+++ b/src/sqlfluff/dialects/dialect_exasol.py
@@ -194,10 +194,6 @@
Delimited(Ref("ColumnDatatypeSegment")),
Ref("UDFParamet... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} | |
saltstack__salt-62278@f77f94a | saltstack/salt | Python | 62,278 | Add memory leak test | ### What does this PR do?
Adds a test for a memory leak by running a couple of state files multiple times and then making sure that the general trend of memory usage after those state runs is downwards.
Essentially, it takes the maximum usage, $max$, during the runs of the state, and the usage just before the state... | 2022-07-05T21:40:18Z | [TECH DEBT] Add memory leak test to the test suite.
Add memory leak test to the test suite.
a. check memory consumption
b. start master, minion
c. check memory consumption
d. run a state file multiple times
e. check memory consumption and make sure it goes back down to the level on step c | [
{
"body": "Add memory leak test to the test suite.\r\n\r\na. check memory consumption \r\nb. start master, minion \r\nc. check memory consumption \r\nd. run a state file multiple times \r\ne. check memory consumption and make sure it goes back down to the level on step c ",
"number": 61105,
"title": "[T... | 7823bcfdc3a4a95b018a142fc0b651e57b59ba21 | {
"head_commit": "f77f94af84084563737f20c5494be1fcbd1c226f",
"head_commit_message": "Remove debug statements",
"patch_to_review": "diff --git a/tests/integration/daemons/test_masterapi.py b/tests/integration/daemons/test_masterapi.py\ndeleted file mode 100644\nindex be511d191bbb..000000000000\n--- a/tests/integra... | [
{
"diff_hunk": "@@ -0,0 +1,119 @@\n+\"\"\"\n+Test autosigning minions based on grain values.\n+\"\"\"\n+\n+import os\n+import shutil\n+import stat\n+\n+import pytest\n+import salt.utils.files\n+import salt.utils.stringutils\n+from tests.support.runtests import RUNTIME_VARS\n+\n+pytestmark = [pytest.mark.slow_te... | 5924eaa28bb28acee92853a190f521671fa5d549 | diff --git a/tests/integration/daemons/test_masterapi.py b/tests/integration/daemons/test_masterapi.py
deleted file mode 100644
index f41ae99ec89b..000000000000
--- a/tests/integration/daemons/test_masterapi.py
+++ /dev/null
@@ -1,83 +0,0 @@
-import os
-import shutil
-import stat
-
-import pytest
-
-import salt.utils.f... | {
"difficulty": "medium",
"estimated_review_effort": 4,
"problem_domain": "Test Suite / CI Enhancements"
} | |
scikit-learn__scikit-learn-20899@17a18cc | scikit-learn/scikit-learn | Python | 20,899 | FIX Remove **params from fit function for FeatureAgglomeration to get more concise error message | #### Reference Issues/PRs
Fixes: #20897
#### What does this implement/fix? Explain your changes.
Removes the **kwargs parameter in `FeatureAgglomeration.fit` to result in a more concise error.
#### Any other comments?
| 2021-08-31T16:51:58Z | FeatureAgglomeration should accept a **kwargs in `fit` signature
### Describe the bug
`FeatureAgglomeration.fit` accepts a `**params` keyword argument. It is delegated to the `AgglomerativeClustering.fit` that does not accept any other parameter than `X` and `y`.
While it would already not work because an error wou... | I can take this! | [
{
"body": "### Describe the bug\n\n`FeatureAgglomeration.fit` accepts a `**params` keyword argument. It is delegated to the `AgglomerativeClustering.fit` that does not accept any other parameter than `X` and `y`.\r\n\r\nWhile it would already not work because an error would be raised by the `AgglomerativeCluste... | d6144caead854577c3b3d07d9714264117ec79a8 | {
"head_commit": "17a18ccfd2911b593513735103c5918e8de4686b",
"head_commit_message": "Fix doc entry",
"patch_to_review": "diff --git a/doc/whats_new/v1.0.rst b/doc/whats_new/v1.0.rst\nindex 42ada70c78049..2b8069d44194a 100644\n--- a/doc/whats_new/v1.0.rst\n+++ b/doc/whats_new/v1.0.rst\n@@ -214,6 +214,10 @@ Changel... | [
{
"diff_hunk": "@@ -1202,8 +1202,8 @@ def __init__(\n )\n self.pooling_func = pooling_func\n \n- def fit(self, X, y=None, **params):\n- \"\"\"Fit the hierarchical clustering on the data.\n+ def fit(self, X, y=None):\n+ \"\"\"Fit the hierarchical clustering on the data",
"... | a72eb32e3167166a1745649f5a0d27cf570ae768 | diff --git a/doc/whats_new/v1.0.rst b/doc/whats_new/v1.0.rst
index 42ada70c78049..015769985b43f 100644
--- a/doc/whats_new/v1.0.rst
+++ b/doc/whats_new/v1.0.rst
@@ -214,6 +214,10 @@ Changelog
of connected components is greater than 1. :pr:`20597` by
`Thomas Fan`_.
+- |Fix| :class:`cluster.FeatureAgglomeration` ... | {
"difficulty": "low",
"estimated_review_effort": 2,
"problem_domain": "Bug Fixes"
} |
sqlfluff__sqlfluff-2351@142e3bc | sqlfluff/sqlfluff | Python | 2,351 | Redefine MySQL Interval segment | <!--Firstly, thanks for adding this feature! Secondly, please check the key steps against the checklist below to make your contribution easy to merge.-->
<!--Please give the Pull Request a meaningful title (including the dialect this PR is for if it is dialect specific), as this will automatically be added to the re... | 2022-01-19T11:30:21Z | MySQL: Dialect cannot parse `INTERVAL -30 DAYS`
## Expected Behaviour
The following statement ought to be parsable:
```
SELECT class, AVG(pageViews), AVG(exitPageViews)
FROM pageview_table
WHERE segment_date = DATE_ADD(CURDATE(), INTERVAL -30 DAY)
GROUP BY class
```
## Observed Behaviour
The statement is not... | [
{
"body": "## Expected Behaviour\r\nThe following statement ought to be parsable:\r\n```\r\nSELECT class, AVG(pageViews), AVG(exitPageViews)\r\nFROM pageview_table\r\nWHERE segment_date = DATE_ADD(CURDATE(), INTERVAL -30 DAY)\r\nGROUP BY class\r\n```\r\n\r\n## Observed Behaviour\r\nThe statement is not parsable... | 3196b6c054e5541a732c38246744f0a0de786088 | {
"head_commit": "142e3bc653107c691bb57f6dfd8617d4e97f5d08",
"head_commit_message": "fix #2224 by redefining interval segment for mysql",
"patch_to_review": "diff --git a/src/sqlfluff/dialects/dialect_mysql.py b/src/sqlfluff/dialects/dialect_mysql.py\nindex 5180ade4e28..83a9bb385d8 100644\n--- a/src/sqlfluff/dial... | [
{
"diff_hunk": "@@ -304,6 +304,25 @@ class TableConstraintSegment(BaseSegment):\n )\n \n \n+@mysql_dialect.segment(replace=True)\n+class IntervalExpressionSegment(BaseSegment):\n+ \"\"\"An interval expression segment.\"\"\"",
"line": null,
"original_line": 309,
"original_start_line": null,
... | ded5f293cfae6f1604b2e6277e6418b4a64bd788 | diff --git a/src/sqlfluff/dialects/dialect_mysql.py b/src/sqlfluff/dialects/dialect_mysql.py
index 5180ade4e28..72ba0ed5962 100644
--- a/src/sqlfluff/dialects/dialect_mysql.py
+++ b/src/sqlfluff/dialects/dialect_mysql.py
@@ -304,6 +304,28 @@ class TableConstraintSegment(BaseSegment):
)
+@mysql_dialect.segment(... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "Bug Fixes"
} | |
scikit-learn__scikit-learn-21078@6ebb43f | scikit-learn/scikit-learn | Python | 21,078 | ENH Adds feature_names_out to impute module | <!--
Thanks for contributing a pull request! Please ensure you have taken a look at
the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md
-->
#### Reference Issues/PRs
<!--
Example: Fixes #1234. See also #3456.
Please use keywords (e.g., Fixes) to create link to th... | 2021-09-17T19:29:24Z | Implement get_feature_names_out for SimpleImputer
### Describe the workflow you want to enable
I would like to get the feature names input to a classifier after imputation.
```
column_trans = ColumnTransformer([('imputed', SimpleImputer(add_indicator=True), x_con)], remainder='drop')
# column_trans = ColumnTrans... | [
{
"body": "### Describe the workflow you want to enable\n\nI would like to get the feature names input to a classifier after imputation. \r\n\r\n```\r\ncolumn_trans = ColumnTransformer([('imputed', SimpleImputer(add_indicator=True), x_con)], remainder='drop')\r\n# column_trans = ColumnTransformer([('scaler', pr... | 7601f87b7a8faaf0d3bd14add9a050b127cbb865 | {
"head_commit": "6ebb43ff89178d639effd2025ac34c02bc4148f8",
"head_commit_message": "BUG Remove use for dtype in concatenate",
"patch_to_review": "diff --git a/doc/whats_new/v1.1.rst b/doc/whats_new/v1.1.rst\nindex 9c1084e393e8d..2b1740e6c6483 100644\n--- a/doc/whats_new/v1.1.rst\n+++ b/doc/whats_new/v1.1.rst\n@@... | [
{
"diff_hunk": "@@ -113,6 +114,14 @@ def _concatenate_indicator(self, X_imputed, X_indicator):\n \n return hstack((X_imputed, X_indicator))\n \n+ def _concatenate_indicator_feature_names_out(self, names, input_features):\n+ if not self.add_indicator:\n+ return names\n+\n+ ind... | 6d86dc5c301ed315b8765fe0373e5f9515bf7b9a | diff --git a/doc/whats_new/v1.1.rst b/doc/whats_new/v1.1.rst
index a473908d8f1e7..cc1af2f237bf9 100644
--- a/doc/whats_new/v1.1.rst
+++ b/doc/whats_new/v1.1.rst
@@ -61,6 +61,13 @@ Changelog
error when 'min_idf' or 'max_idf' are floating-point numbers greater than 1.
:pr:`20752` by :user:`Alek Lefebvre <AlekLefebv... | {
"difficulty": "medium",
"estimated_review_effort": 3,
"problem_domain": "New Feature Additions"
} |
Subsets and Splits
Review Test Instances
Retrieves basic metadata about code review instances but doesn't provide any analytical insights or patterns beyond raw data access.