instance_id
stringlengths
10
57
file_changes
listlengths
1
15
repo
stringlengths
7
53
base_commit
stringlengths
40
40
problem_statement
stringlengths
11
52.5k
patch
stringlengths
251
7.06M
narwhals-dev__narwhals-178
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "narwhals/_pandas_like/dataframe.py:PandasDataFrame.__getitem__" ], "edited_modules": [ "narwhals/_pandas_like/dataframe.py:PandasDataFrame" ] }, "file": "narwhals/_pand...
narwhals-dev/narwhals
c51039cda5fb23a3dd068e121ee9c2da70891700
Allow slicing eager dataframes i.e. ``` df = nw.from_native(df_any) df[1:] ``` should select all rows except for the first one
diff --git a/narwhals/_pandas_like/dataframe.py b/narwhals/_pandas_like/dataframe.py index 683d120b..687b1134 100644 --- a/narwhals/_pandas_like/dataframe.py +++ b/narwhals/_pandas_like/dataframe.py @@ -5,6 +5,7 @@ from typing import TYPE_CHECKING from typing import Any from typing import Iterable from typing import...
narwhals-dev__narwhals-199
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "narwhals/_pandas_like/expr.py:PandasExpr.filter" ], "edited_modules": [ "narwhals/_pandas_like/expr.py:PandasExpr" ] }, "file": "narwhals/_pandas_like/expr.py" }, {...
narwhals-dev/narwhals
3e6059a60ec23c40025d15e9b49ec8eec57e6854
wrong argument in Expr.filter and Series.filter - "other" instead of "*predicates" I'm working on the docstring for Expr.filter() but I noticed that the name of the argument suggests it accepts "other" df/series. It's also the case for Series.filter() Dataframe.filter() has *predicates as an argument and so does Expr...
diff --git a/narwhals/_pandas_like/expr.py b/narwhals/_pandas_like/expr.py index f9020824..1dc4f306 100644 --- a/narwhals/_pandas_like/expr.py +++ b/narwhals/_pandas_like/expr.py @@ -184,8 +184,12 @@ class PandasExpr: def is_in(self, other: Any) -> Self: return register_expression_call(self, "is_in", othe...
narwhals-dev__narwhals-207
[ { "changes": { "added_entities": [ "narwhals/_pandas_like/expr.py:PandasExpr.quantile" ], "added_modules": null, "edited_entities": [ "narwhals/_pandas_like/expr.py:PandasExpr.from_column_names", "narwhals/_pandas_like/expr.py:PandasExpr.cast", "narwhals/_...
narwhals-dev/narwhals
2a70adb140f0df6f3e2c3f82366586f3dbdcfe9b
Add Expr.quantile and Series.quantile https://docs.pola.rs/py-polars/html/reference/expressions/api/polars.Expr.quantile.html#polars.Expr.quantile I'm _slightly_ worried that the default interpolation method might change in Polars at some point, so we should probably not put any default for it in Narwhals and force ...
diff --git a/.github/workflows/extremes.yml b/.github/workflows/extremes.yml index 884cb785..771ed16f 100644 --- a/.github/workflows/extremes.yml +++ b/.github/workflows/extremes.yml @@ -29,7 +29,7 @@ jobs: - name: install-reqs run: python -m pip install --upgrade tox virtualenv setuptools pip -r requir...
narwhals-dev__narwhals-254
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "narwhals/_pandas_like/utils.py:reverse_translate_dtype" ], "edited_modules": [ "narwhals/_pandas_like/utils.py:reverse_translate_dtype" ] }, "file": "narwhals/_pandas_l...
narwhals-dev/narwhals
ad97d7ede677875c74ece6110455095644cfdaab
[Bug]: pandas cast not working ### Describe the bug import polars as pl import pandas as pd df_polars = pl.DataFrame({'a': [1]}) nw.from_native(df_polars).select(nw.col("a").cast(nw.String) + "hi") df_pandas = pd.DataFrame({'a': [1]}) nw.from_native(df_pandas).select(nw.col("a").cast(nw.String) + "hi") polar...
diff --git a/narwhals/_pandas_like/utils.py b/narwhals/_pandas_like/utils.py index 74dd9682..37c69173 100644 --- a/narwhals/_pandas_like/utils.py +++ b/narwhals/_pandas_like/utils.py @@ -437,7 +437,6 @@ def reverse_translate_dtype( # noqa: PLR0915 from narwhals import dtypes dtype_backend = get_dtype_backe...
narwhals-dev__narwhals-265
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": null, "edited_modules": null }, "file": "narwhals/__init__.py" }, { "changes": { "added_entities": [ "narwhals/utils.py:maybe_convert_dtypes" ], "added_modules": [ ...
narwhals-dev/narwhals
a0a0e57358f596aa1a55bd4b31c6bd7ae9d31d45
Add `narwhals.maybe_convert_dtypes` pandas-like libraries have `convert_dtypes`: https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.convert_dtypes.html People use this to "promote" types - e.g., to promote all types to use the pyarrow-backed ones. Polars doesn't have anything like this, because each ty...
diff --git a/docs/api-reference/narwhals.md b/docs/api-reference/narwhals.md index 863d3ad9..50555f31 100644 --- a/docs/api-reference/narwhals.md +++ b/docs/api-reference/narwhals.md @@ -14,6 +14,7 @@ Here are the top-level functions available in Narwhals. - len - maybe_align_index - maybe_se...
narwhals-dev__narwhals-289
[ { "changes": { "added_entities": [ "narwhals/_pandas_like/dataframe.py:PandasDataFrame.write_parquet" ], "added_modules": null, "edited_entities": null, "edited_modules": [ "narwhals/_pandas_like/dataframe.py:PandasDataFrame" ] }, "file": "narwhals/_pa...
narwhals-dev/narwhals
9bb4db34a44476758cb31d20c761a3cd0c73f9bc
[Enh]: Add support for DataFrame.write_parquet ### We would like to learn about your use case. For example, if this feature is needed to adopt Narwhals in an open source project, could you please enter the link to it below? _No response_ ### Please describe the purpose of the new feature or describe the problem to ...
diff --git a/docs/api-reference/dataframe.md b/docs/api-reference/dataframe.md index bb4f0f2d..a7f518d2 100644 --- a/docs/api-reference/dataframe.md +++ b/docs/api-reference/dataframe.md @@ -28,5 +28,6 @@ - unique - with_columns - with_row_index + - write_parquet show_source: fa...
narwhals-dev__narwhals-306
[ { "changes": { "added_entities": [ "narwhals/_pandas_like/expr.py:PandasExpr.round", "narwhals/_pandas_like/expr.py:PandasExprStringNamespace.starts_with", "narwhals/_pandas_like/expr.py:PandasExprStringNamespace.slice" ], "added_modules": null, "edited_entities":...
narwhals-dev/narwhals
aa6e40777ed51317816e9310a8e8cddec9564cc9
[Enh]: Support for nw.round() ### We would like to learn about your use case. For example, if this feature is needed to adopt Narwhals in an open source project, could you please enter the link to it below? _No response_ ### Please describe the purpose of the new feature or describe the problem to solve. Came up w...
diff --git a/docs/api-reference/expressions.md b/docs/api-reference/expressions.md index 0118a05c..a8062b03 100644 --- a/docs/api-reference/expressions.md +++ b/docs/api-reference/expressions.md @@ -28,6 +28,7 @@ - n_unique - over - quantile + - round - sample - shift...
narwhals-dev__narwhals-321
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": null, "edited_modules": null }, "file": "narwhals/__init__.py" }, { "changes": { "added_entities": [ "narwhals/_pandas_like/namespace.py:PandasNamespace.lit" ], "add...
narwhals-dev/narwhals
12fc3b7bb36b1861c794ada416ba38551b879c38
[Enh]: support creating column with literal value ### We would like to learn about your use case. For example, if this feature is needed to adopt Narwhals in an open source project, could you please enter the link to it below? I'm currently looking at #204 , I found a place where this could be helpful ### Please de...
diff --git a/docs/api-reference/narwhals.md b/docs/api-reference/narwhals.md index 5b623303..e2246c26 100644 --- a/docs/api-reference/narwhals.md +++ b/docs/api-reference/narwhals.md @@ -15,6 +15,7 @@ Here are the top-level functions available in Narwhals. - maybe_align_index - maybe_set_index ...
narwhals-dev__narwhals-323
[ { "changes": { "added_entities": [ "narwhals/_pandas_like/expr.py:PandasExpr.len" ], "added_modules": null, "edited_entities": null, "edited_modules": [ "narwhals/_pandas_like/expr.py:PandasExpr" ] }, "file": "narwhals/_pandas_like/expr.py" }, { ...
narwhals-dev/narwhals
1e31e5852a9182a0d5945be3942152105f145377
[Enh]: Support `Expr.len()` ### We would like to learn about your use case. For example, if this feature is needed to adopt Narwhals in an open source project, could you please enter the link to it below? _No response_ ### Please describe the purpose of the new feature or describe the problem to solve. `nw.len()` ...
diff --git a/docs/api-reference/expressions.md b/docs/api-reference/expressions.md index a8062b03..a717fed7 100644 --- a/docs/api-reference/expressions.md +++ b/docs/api-reference/expressions.md @@ -21,6 +21,7 @@ - is_last_distinct - is_null - is_unique + - len - max ...
narwhals-dev__narwhals-341
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": null, "edited_modules": null }, "file": "narwhals/__init__.py" }, { "changes": { "added_entities": null, "added_modules": null, "edited_entities": null, "edited_module...
narwhals-dev/narwhals
f77cd214441ccd1cd4cce45a4782823794a2c93b
feat: support nw.Date we need to support the Date dtype
diff --git a/narwhals/__init__.py b/narwhals/__init__.py index a40f8018..e81f4236 100644 --- a/narwhals/__init__.py +++ b/narwhals/__init__.py @@ -3,6 +3,7 @@ from narwhals.dataframe import DataFrame from narwhals.dataframe import LazyFrame from narwhals.dtypes import Boolean from narwhals.dtypes import Categorical ...
narwhals-dev__narwhals-344
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": null, "edited_modules": null }, "file": "narwhals/__init__.py" }, { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "narwhals/_panda...
narwhals-dev/narwhals
702766578ffb70a924c723956e9d3127a2e80c23
add nw.Object dtype This shouldn't do anything clever
diff --git a/docs/api-reference/dtypes.md b/docs/api-reference/dtypes.md index b1e313ba..d84b0684 100644 --- a/docs/api-reference/dtypes.md +++ b/docs/api-reference/dtypes.md @@ -18,6 +18,7 @@ - Categorical - String - Datetime + - Object show_root_heading: false show_sour...
narwhals-dev__narwhals-351
[ { "changes": { "added_entities": [ "narwhals/_pandas_like/dataframe.py:PandasDataFrame.rows" ], "added_modules": null, "edited_entities": null, "edited_modules": [ "narwhals/_pandas_like/dataframe.py:PandasDataFrame" ] }, "file": "narwhals/_pandas_like...
narwhals-dev/narwhals
5c018ca9b629767d6636d0811783682c17898161
[Enh]: Add support for DataFrame.rows ### We would like to learn about your use case. For example, if this feature is needed to adopt Narwhals in an open source project, could you please enter the link to it below? _No response_ ### Please describe the purpose of the new feature or describe the problem to solve. I...
diff --git a/docs/api-reference/dataframe.md b/docs/api-reference/dataframe.md index 6165c706..67520527 100644 --- a/docs/api-reference/dataframe.md +++ b/docs/api-reference/dataframe.md @@ -20,6 +20,7 @@ - null_count - pipe - rename + - rows - schema - select ...
narwhals-dev__narwhals-369
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": null, "edited_modules": null }, "file": "narwhals/__init__.py" }, { "changes": { "added_entities": null, "added_modules": null, "edited_entities": null, "edited_module...
narwhals-dev/narwhals
e8449cc93bbec25b974038886d4a5eb0eb142e4f
feat: add dtypes.Unknown currently this fails: ```python data = {'a': [1,2,3]} df = pd.DataFrame({'a': pd.period_range('2000', periods=3, freq='M'), 'b': [1, 2, 3]}) print(nw.from_native(df).select(nw.selectors.numeric())) ``` we should let unknown dtypes just pass through
diff --git a/docs/api-reference/dtypes.md b/docs/api-reference/dtypes.md index c89b7f49..848e9e58 100644 --- a/docs/api-reference/dtypes.md +++ b/docs/api-reference/dtypes.md @@ -20,6 +20,7 @@ - Datetime - Duration - Object + - Unknown show_root_heading: false show_source...
narwhals-dev__narwhals-378
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": null, "edited_modules": null }, "file": "narwhals/__init__.py" }, { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "narwhals/_arrow...
narwhals-dev/narwhals
bfe21e67ac4aaf34c381cb41d893ae757c00e540
[Enh]: Support for anti-join ### We would like to learn about your use case. For example, if this feature is needed to adopt Narwhals in an open source project, could you please enter the link to it below? _No response_ ### Please describe the purpose of the new feature or describe the problem to solve. Hands down...
diff --git a/README.md b/README.md index 1ee3056e..c0a28537 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,8 @@ Extremely lightweight and extensible compatibility layer between Polars, pandas, - [Read the documentation](https://narwhals-dev.github.io/narwhals/) - [Chat with us on Discord!](https://discord.gg/V...
narwhals-dev__narwhals-394
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "narwhals/_pandas_like/dataframe.py:PandasDataFrame.drop" ], "edited_modules": [ "narwhals/_pandas_like/dataframe.py:PandasDataFrame" ] }, "file": "narwhals/_pandas_like...
narwhals-dev/narwhals
bce5efa11110227b538f77fa6865d8bf51a68ad9
[Bug]: pandas-like `drop` fails with positional arguments ### Describe the bug pandas like dataframes raise error when dropping multiple columns as positional arguments ### Steps or code to reproduce the bug ```py import narwhals as nw import pandas as pd df_raw = pd.DataFrame({ "a": [1, 3, 2], ...
diff --git a/narwhals/_pandas_like/dataframe.py b/narwhals/_pandas_like/dataframe.py index 2b68e846..443e2add 100644 --- a/narwhals/_pandas_like/dataframe.py +++ b/narwhals/_pandas_like/dataframe.py @@ -249,8 +249,8 @@ class PandasDataFrame: def rename(self, mapping: dict[str, str]) -> Self: return self._...
narwhals-dev__narwhals-479
[ { "changes": { "added_entities": [ "narwhals/_arrow/dataframe.py:ArrowDataFrame.get_column" ], "added_modules": null, "edited_entities": null, "edited_modules": [ "narwhals/_arrow/dataframe.py:ArrowDataFrame" ] }, "file": "narwhals/_arrow/dataframe.py"...
narwhals-dev/narwhals
4366f9c1fef61ac7e004db313f5f4cd1b3f29b78
Inconsistency in using `DataFrame__getitem__` when pandas has non-string names Example: ```python import narwhals as nw import pandas as pd import polars as pl @nw.narwhalify def func(df): return df[df.columns[0]] ``` We then get: ```python In [17]: func(pd.DataFrame({'a': [1, 2]})) Out[17]: 0 1...
diff --git a/docs/api-reference/dataframe.md b/docs/api-reference/dataframe.md index a0003729..9fa144ce 100644 --- a/docs/api-reference/dataframe.md +++ b/docs/api-reference/dataframe.md @@ -4,11 +4,13 @@ handler: python options: members: + - __getitem__ - clone - columns ...
narwhals-dev__narwhals-508
[ { "changes": { "added_entities": [ "narwhals/_arrow/dataframe.py:ArrowDataFrame.join" ], "added_modules": null, "edited_entities": null, "edited_modules": [ "narwhals/_arrow/dataframe.py:ArrowDataFrame" ] }, "file": "narwhals/_arrow/dataframe.py" }, ...
narwhals-dev/narwhals
1f3350f38fd92d677ba265cd194a6a258fbcb2d9
[Bug]: should `_create_native_series` return narwhals series? ### Describe the bug I was trying to increase coverage by adding a test that calls [`ArrowNamespace._create_native_series`](https://github.com/narwhals-dev/narwhals/blob/main/narwhals/_arrow/namespace.py#L87): such method is accessed in `_expression_parsing...
diff --git a/narwhals/_arrow/dataframe.py b/narwhals/_arrow/dataframe.py index 768fcb32..b3ef89fc 100644 --- a/narwhals/_arrow/dataframe.py +++ b/narwhals/_arrow/dataframe.py @@ -3,6 +3,7 @@ from __future__ import annotations from typing import TYPE_CHECKING from typing import Any from typing import Iterable +from t...
narwhals-dev__narwhals-519
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "narwhals/translate.py:from_native" ], "edited_modules": [ "narwhals/translate.py:from_native" ] }, "file": "narwhals/translate.py" } ]
narwhals-dev/narwhals
6db70d6272667853ba227e3643b6cd5ad5e6f283
[Enh]: Raise error for improper combinations of objects in the from_native function ### Please describe the purpose of the new feature or describe the problem to solve. See this [snippet](https://github.com/narwhals-dev/narwhals/blob/c904b102bd95dec026ce756cecfda15dabe71f41/narwhals/translate.py#L262-L264)
diff --git a/narwhals/translate.py b/narwhals/translate.py index e85caa2e..61653095 100644 --- a/narwhals/translate.py +++ b/narwhals/translate.py @@ -258,8 +258,10 @@ def from_native( # noqa: PLR0915 from narwhals.utils import parse_version if series_only: + if allow_series is False: + m...
narwhals-dev__narwhals-546
[ { "changes": { "added_entities": [ "narwhals/_pandas_like/dataframe.py:PandasLikeDataFrame.pivot" ], "added_modules": null, "edited_entities": null, "edited_modules": [ "narwhals/_pandas_like/dataframe.py:PandasLikeDataFrame" ] }, "file": "narwhals/_pa...
narwhals-dev/narwhals
2dae73ffab9704b683f90379f32b7ed25d8c013f
[Enh]: Support for `DataFrame.pivot` ### We would like to learn about your use case. For example, if this feature is needed to adopt Narwhals in an open source project, could you please enter the link to it below? _No response_ ### Please describe the purpose of the new feature or describe the problem to solve. _p...
diff --git a/docs/api-reference/dataframe.md b/docs/api-reference/dataframe.md index 447acbc1..00ff2122 100644 --- a/docs/api-reference/dataframe.md +++ b/docs/api-reference/dataframe.md @@ -26,6 +26,7 @@ - lazy - null_count - pipe + - pivot - rename - row - ...
narwhals-dev__narwhals-577
[ { "changes": { "added_entities": [ "narwhals/_arrow/expr.py:ArrowExpr.unique", "narwhals/_arrow/expr.py:ArrowExpr.sort" ], "added_modules": null, "edited_entities": null, "edited_modules": [ "narwhals/_arrow/expr.py:ArrowExpr" ] }, "file": "nar...
narwhals-dev/narwhals
dc2b100b4ddf38c78ad098bc5bd827fd591af6f7
Series.to_dummies Bit of a tricky one, but it's one that Formulaic use Polars has `Series.to_dummies`, pandas `pd.get_dummies`, no big deal πŸ€” need to figure out how to do it for PyArrow
diff --git a/docs/api-reference/series.md b/docs/api-reference/series.md index 0d409408..bf607855 100644 --- a/docs/api-reference/series.md +++ b/docs/api-reference/series.md @@ -44,6 +44,7 @@ - std - sum - tail + - to_dummies - to_frame - to_list - to_numpy ...
narwhals-dev__narwhals-582
[ { "changes": { "added_entities": [ "narwhals/expr.py:Expr.pipe" ], "added_modules": null, "edited_entities": null, "edited_modules": [ "narwhals/expr.py:Expr" ] }, "file": "narwhals/expr.py" }, { "changes": { "added_entities": [ "...
narwhals-dev/narwhals
ffef9591b767d5665f8956e6cb117dd02899ae79
feat: Add `Series.pipe`, similar to `DataFrame.pipe` Take a look at `DataFrame.pipe`, this should be quite similar
diff --git a/docs/api-reference/expr.md b/docs/api-reference/expr.md index d37a1266..cc1290a8 100644 --- a/docs/api-reference/expr.md +++ b/docs/api-reference/expr.md @@ -33,6 +33,7 @@ - null_count - n_unique - over + - pipe - quantile - round - sample diff -...
narwhals-dev__narwhals-595
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "narwhals/_pandas_like/dataframe.py:PandasLikeDataFrame.with_columns" ], "edited_modules": [ "narwhals/_pandas_like/dataframe.py:PandasLikeDataFrame" ] }, "file": "narwh...
narwhals-dev/narwhals
7289d6f01a59f94dd8e5d2946d0ca992b790049c
[Enh]: clarify and/or expand support for `int` column names for Pandas-like dataframes ### We would like to learn about your use case. For example, if this feature is needed to adopt Narwhals in an open source project, could you please enter the link to it below? I was looking at how we support `int` column names...
diff --git a/narwhals/_pandas_like/dataframe.py b/narwhals/_pandas_like/dataframe.py index db40fb65..d214a1f4 100644 --- a/narwhals/_pandas_like/dataframe.py +++ b/narwhals/_pandas_like/dataframe.py @@ -285,9 +285,9 @@ class PandasLikeDataFrame: backend_version=self._backend_version, ) ...
narwhals-dev__narwhals-604
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": null, "edited_modules": null }, "file": "narwhals/__init__.py" }, { "changes": { "added_entities": [ "narwhals/_arrow/namespace.py:ArrowNamespace.any_horizontal" ], ...
narwhals-dev/narwhals
1a3824d52b9c558205f5fd1cdf40c2e489eb3c93
feat: PyArrow table support It might be possible to support PyArrow tables in Narwhals - investigations / implementations would be very welcome!
diff --git a/README.md b/README.md index 00dba4c3..bd85b56b 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,8 @@ Extremely lightweight and extensible compatibility layer between dataframe libraries! -- **Full API support**: cuDF, Modin, pandas, Polars -- **Interchange-level support**: Ibis, PyArrow, Vaex, anyt...
narwhals-dev__narwhals-606
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "narwhals/_polars/namespace.py:PolarsNamespace.len" ], "edited_modules": [ "narwhals/_polars/namespace.py:PolarsNamespace" ] }, "file": "narwhals/_polars/namespace.py" ...
narwhals-dev/narwhals
82fb963cf9683e83b5b9f413bca47d64f9000bee
feat: add `schema` argument to `from_dict` See https://github.com/narwhals-dev/narwhals/pull/602#discussion_r1688654218 for context
diff --git a/narwhals/_polars/namespace.py b/narwhals/_polars/namespace.py index 96a97132..d5c8307f 100644 --- a/narwhals/_polars/namespace.py +++ b/narwhals/_polars/namespace.py @@ -55,7 +55,7 @@ class PolarsNamespace: from narwhals._polars.expr import PolarsExpr pl = get_polars() - if self....
narwhals-dev__narwhals-624
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "narwhals/dataframe.py:DataFrame.__getitem__" ], "edited_modules": [ "narwhals/dataframe.py:DataFrame" ] }, "file": "narwhals/dataframe.py" } ]
narwhals-dev/narwhals
cd0af073f95e76749dcd8265c7c19400d9c74d5b
err: raise informative error if `__getitem__` is used and first element is scalar either that, or support it πŸ˜„
diff --git a/narwhals/dataframe.py b/narwhals/dataframe.py index 0f4d8e94..34e71c41 100644 --- a/narwhals/dataframe.py +++ b/narwhals/dataframe.py @@ -520,6 +520,17 @@ class DataFrame(BaseFrame[FrameT]): 2 ] """ + if ( + isinstance(item, tuple) + and l...
narwhals-dev__narwhals-701
[ { "changes": { "added_entities": [ "narwhals/_pandas_like/expr.py:PandasLikeExpr.clip" ], "added_modules": null, "edited_entities": null, "edited_modules": [ "narwhals/_pandas_like/expr.py:PandasLikeExpr" ] }, "file": "narwhals/_pandas_like/expr.py" ...
narwhals-dev/narwhals
65e9e7c7079059aeeadf3fff43987b0d94dcf37d
feat: Add clip expression to the api ### We would like to learn about your use case. For example, if this feature is needed to adopt Narwhals in an open source project, could you please enter the link to it below? _No response_ ### Please describe the purpose of the new feature or describe the problem to solve...
diff --git a/docs/api-reference/expr.md b/docs/api-reference/expr.md index 492066aa..d37a1266 100644 --- a/docs/api-reference/expr.md +++ b/docs/api-reference/expr.md @@ -18,6 +18,7 @@ - filter - gather_every - head + - clip - is_between - is_duplicated - is_...
narwhals-dev__narwhals-769
[ { "changes": { "added_entities": [ "narwhals/_arrow/series.py:ArrowSeries.to_arrow" ], "added_modules": null, "edited_entities": null, "edited_modules": [ "narwhals/_arrow/series.py:ArrowSeries" ] }, "file": "narwhals/_arrow/series.py" }, { "ch...
narwhals-dev/narwhals
793f0a49cef2d09c67c3be313112a6091a62e925
feat: add Series.to_arrow
diff --git a/docs/api-reference/series.md b/docs/api-reference/series.md index 2479196a..7b7f62b8 100644 --- a/docs/api-reference/series.md +++ b/docs/api-reference/series.md @@ -47,6 +47,7 @@ - std - sum - tail + - to_arrow - to_dummies - to_frame - to_list ...
narwhals-dev__narwhals-786
[ { "changes": { "added_entities": [ "narwhals/dataframe.py:DataFrame.__arrow_c_stream__" ], "added_modules": null, "edited_entities": null, "edited_modules": [ "narwhals/dataframe.py:DataFrame" ] }, "file": "narwhals/dataframe.py" }, { "changes"...
narwhals-dev/narwhals
6075ec7fab33e32e29dcf7d57d7421ab1d1e8090
[Enh]: Pass through the Arrow PyCapsule Interface ### We would like to learn about your use case. For example, if this feature is needed to adopt Narwhals in an open source project, could you please enter the link to it below? The [Arrow PyCapsule Protocol](https://arrow.apache.org/docs/format/CDataInterface/PyCapsu...
diff --git a/docs/api-reference/dataframe.md b/docs/api-reference/dataframe.md index 676f6407..b251b2a5 100644 --- a/docs/api-reference/dataframe.md +++ b/docs/api-reference/dataframe.md @@ -4,6 +4,7 @@ handler: python options: members: + - __arrow_c_stream__ - __getitem__ - cl...
narwhals-dev__narwhals-787
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": null, "edited_modules": null }, "file": "narwhals/__init__.py" }, { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "narwhals/_dask/...
narwhals-dev/narwhals
6fbfb7783e510b5b27b5989b20738a4fe629f8ef
Easy way to create nw.Series from numpy array We may need a convenience function outside of the Polars API for this, such as: ```python s: nw.Series m: np.ndarray new_series = nw.new_series(m, native_namespace=s.__native_namespace__()) ```
diff --git a/docs/api-reference/narwhals.md b/docs/api-reference/narwhals.md index 16bc6621..275a865c 100644 --- a/docs/api-reference/narwhals.md +++ b/docs/api-reference/narwhals.md @@ -17,14 +17,15 @@ Here are the top-level functions available in Narwhals. - get_native_namespace - is_ordered_categor...
narwhals-dev__narwhals-816
[ { "changes": { "added_entities": [ "narwhals/_dask/expr.py:DaskExprDateTimeNamespace.to_string" ], "added_modules": null, "edited_entities": [ "narwhals/_dask/expr.py:DaskExpr.clip" ], "edited_modules": [ "narwhals/_dask/expr.py:DaskExpr", "nar...
narwhals-dev/narwhals
949ce0505e55fb57866e3ddb56dd8b4c9359d6ea
"random versions" ci failure ``` ______________________ test_string[dask_lazy_constructor] ______________________ constructor = <function dask_lazy_constructor at 0x7f2fa4682af0> def test_string(constructor: Any) -> None: df = nw.from_native(constructor(data)) result = df.select(string()) ...
diff --git a/.github/workflows/extremes.yml b/.github/workflows/extremes.yml index e9d0d673..ae9c7900 100644 --- a/.github/workflows/extremes.yml +++ b/.github/workflows/extremes.yml @@ -99,8 +99,8 @@ jobs: run: uv pip install --upgrade tox virtualenv setuptools pip -r requirements-dev.txt --system - na...
narwhals-dev__narwhals-832
[ { "changes": { "added_entities": [ "narwhals/_arrow/dataframe.py:ArrowDataFrame.__array__", "narwhals/_arrow/dataframe.py:ArrowDataFrame.write_csv" ], "added_modules": null, "edited_entities": null, "edited_modules": [ "narwhals/_arrow/dataframe.py:ArrowData...
narwhals-dev/narwhals
39c178786c04f50f396f542a77f45a0bdbe23d4f
feat: add DataFrame.write_csv We have `DataFrame.write_parquet`, so `DataFrame.write_csv` should probably also be in scope Noticed this while looking further into Altair https://github.com/vega/altair/issues/3549
diff --git a/docs/api-reference/dataframe.md b/docs/api-reference/dataframe.md index b251b2a5..08ad0f7c 100644 --- a/docs/api-reference/dataframe.md +++ b/docs/api-reference/dataframe.md @@ -39,6 +39,7 @@ - unique - with_columns - with_row_index + - write_csv - write_parquet ...
narwhals-dev__narwhals-867
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": null, "edited_modules": null }, "file": "narwhals/__init__.py" }, { "changes": { "added_entities": [ "narwhals/stable/v1.py:maybe_get_index" ], "added_modules": [ ...
narwhals-dev/narwhals
aaf5ecf909dd1e76aafecbea5c020874c4e9fc6f
feat: add `maybe_get_index` Similar to the other `maybe_` pandas-like-specific functions https://narwhals-dev.github.io/narwhals/api-reference/narwhals/#narwhals.maybe_set_index. Regardless of whether or not they use Narwhals in https://github.com/pymc-devs/pymc/issues/7462, it does look like it would be useful there, ...
diff --git a/docs/api-reference/narwhals.md b/docs/api-reference/narwhals.md index d808263a..9d7ac384 100644 --- a/docs/api-reference/narwhals.md +++ b/docs/api-reference/narwhals.md @@ -21,6 +21,7 @@ Here are the top-level functions available in Narwhals. - max - maybe_align_index - maybe_co...
narwhals-dev__narwhals-917
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "narwhals/_arrow/group_by.py:agg_arrow" ], "edited_modules": [ "narwhals/_arrow/group_by.py:agg_arrow" ] }, "file": "narwhals/_arrow/group_by.py" }, { "changes":...
narwhals-dev/narwhals
4cf94ce268c92b4d26b7e4fed6e245d3eee1bdfc
[Bug]: n_unique in `groupby-agg` raises ### Describe the bug reported here https://github.com/narwhals-dev/narwhals/pull/910/files#r1746497849 ### Steps or code to reproduce the bug https://github.com/narwhals-dev/narwhals/pull/910/files#r1746497849 ### Expected results no error ### Actual results error ``` At...
diff --git a/narwhals/_arrow/group_by.py b/narwhals/_arrow/group_by.py index 27c7ff36..78b241c9 100644 --- a/narwhals/_arrow/group_by.py +++ b/narwhals/_arrow/group_by.py @@ -15,6 +15,12 @@ if TYPE_CHECKING: from narwhals._arrow.expr import ArrowExpr from narwhals._arrow.typing import IntoArrowExpr +POLARS_...
narwhals-dev__narwhals-935
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "narwhals/_arrow/dataframe.py:ArrowDataFrame.__getitem__" ], "edited_modules": [ "narwhals/_arrow/dataframe.py:ArrowDataFrame" ] }, "file": "narwhals/_arrow/dataframe.py...
narwhals-dev/narwhals
5dc43000dfcd3e93c81f6a1cb90ea1d8bda38ffa
[Enh]: support `__getitem__` with single tuple of column names ### We would like to learn about your use case. For example, if this feature is needed to adopt Narwhals in an open source project, could you please enter the link to it below? _No response_ ### Please describe the purpose of the new feature or describe...
diff --git a/narwhals/_arrow/dataframe.py b/narwhals/_arrow/dataframe.py index fa5a6995..f409ef73 100644 --- a/narwhals/_arrow/dataframe.py +++ b/narwhals/_arrow/dataframe.py @@ -121,7 +121,12 @@ class ArrowDataFrame: def __getitem__(self, item: slice) -> ArrowDataFrame: ... def __getitem__( - self, ...
narwhals-dev__narwhals-941
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "narwhals/_arrow/dataframe.py:ArrowDataFrame.__getitem__" ], "edited_modules": [ "narwhals/_arrow/dataframe.py:ArrowDataFrame" ] }, "file": "narwhals/_arrow/dataframe.py...
narwhals-dev/narwhals
270adbd432259f21a24f8f9a4f3121ee19a3d646
docs: add "appears on" to the readme - superdatascience podcast - sample space podcast - pycon italy, pycon lithuania talks - polars blog post - quansight labs blog post (w/ scikit-lego) it might be worth fitting these in somewhere
diff --git a/README.md b/README.md index d26107e6..74630fd0 100644 --- a/README.md +++ b/README.md @@ -113,6 +113,31 @@ provided some funding / development time: If you contribute to Narwhals on your organization's time, please let us know. We'd be happy to add your employer to this list! +## Appears on + +Narwhals...
narwhals-dev__narwhals-944
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "narwhals/_dask/group_by.py:DaskLazyGroupBy.agg", "narwhals/_dask/group_by.py:agg_dask" ], "edited_modules": [ "narwhals/_dask/group_by.py:DaskLazyGroupBy", "narwhals/...
narwhals-dev/narwhals
e9afffd233ed4b4df5364dc8c16ba00e16f86871
[Bug]: pandas-like fails for no aggregations in group by context ### Describe the bug > RuntimeError: Congrats, you entered unreachable code. Please report a bug to https://github.com/narwhals-dev/narwhals/issues. Do I win something? Empty aggs are allowed in polars, but we enter unreachable code in pandas-like οΏ½...
diff --git a/narwhals/_dask/group_by.py b/narwhals/_dask/group_by.py index 463d6fc5..d5fbaaf9 100644 --- a/narwhals/_dask/group_by.py +++ b/narwhals/_dask/group_by.py @@ -72,6 +72,7 @@ class DaskLazyGroupBy: output_names.extend(expr._output_names) return agg_dask( + self._df, ...
narwhals-dev__narwhals-949
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": null, "edited_modules": null }, "file": "narwhals/__init__.py" }, { "changes": { "added_entities": [ "narwhals/_arrow/series.py:ArrowSeries.scatter" ], "added_module...
narwhals-dev/narwhals
eed721b35c7d24cbc4d6de5466652a6cb80d27d5
[Bug]: PyArrow: multi-element `__getitem__` is not supported ### Describe the bug The code below raises ```python Traceback (most recent call last): File "/home/marcogorelli/polars-api-compat-dev/t.py", line 20, in <module> print(func(pa.table(data))) ^^^^^^^^^^^^^^^^^^^^ File "/home/marcogorel...
diff --git a/docs/api-reference/series.md b/docs/api-reference/series.md index b637f550..c016b566 100644 --- a/docs/api-reference/series.md +++ b/docs/api-reference/series.md @@ -12,6 +12,7 @@ - any - arg_true - cast + - clip - count - cum_sum - diff @@ -22,7...
narwhals-dev__narwhals-960
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "narwhals/_arrow/utils.py:native_to_narwhals_dtype", "narwhals/_arrow/utils.py:narwhals_to_native_dtype" ], "edited_modules": [ "narwhals/_arrow/utils.py:native_to_narwhals_dt...
narwhals-dev/narwhals
e3d2a4b98ce9581d17bfac35f8166962847b1be3
[Enh]: Add time units and time zone specifics ### Please describe the purpose of the new feature or describe the problem to solve. See this [snippet](https://github.com/narwhals-dev/narwhals/blob/c904b102bd95dec026ce756cecfda15dabe71f41/narwhals/_pandas_like/utils.py#L287-L296) ```python if str(dtype).start...
diff --git a/.github/workflows/extremes.yml b/.github/workflows/extremes.yml index f11a4f4b..858d0b6e 100644 --- a/.github/workflows/extremes.yml +++ b/.github/workflows/extremes.yml @@ -119,6 +119,8 @@ jobs: kaggle kernels output "marcogorelli/variable-brink-glacier" - name: install-polars r...
narwhals-dev__narwhals-974
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "narwhals/_arrow/expr.py:ArrowExpr.sample" ], "edited_modules": [ "narwhals/_arrow/expr.py:ArrowExpr" ] }, "file": "narwhals/_arrow/expr.py" }, { "changes": { ...
narwhals-dev/narwhals
586f8d701b56eee1ab4d48d4fee5c9e93c8ca127
[Enh]: Random seed for `sample` ### We would like to learn about your use case. For example, if this feature is needed to adopt Narwhals in an open source project, could you please enter the link to it below? I would like to use the `sample` method that allows for reproducibility. However, there is no random state p...
diff --git a/narwhals/_arrow/expr.py b/narwhals/_arrow/expr.py index 24e4fe5c..b324be2b 100644 --- a/narwhals/_arrow/expr.py +++ b/narwhals/_arrow/expr.py @@ -249,12 +249,18 @@ class ArrowExpr: def sample( self: Self, n: int | None = None, - fraction: float | None = None, *, + ...
narwhals-dev__narwhals-978
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "narwhals/_arrow/dataframe.py:ArrowDataFrame.__getitem__" ], "edited_modules": [ "narwhals/_arrow/dataframe.py:ArrowDataFrame" ] }, "file": "narwhals/_arrow/dataframe.py...
narwhals-dev/narwhals
77f505aaff1f25e57e8b00115f91f49ac64cf218
[Bug]: Pyarrow `__getitem__` fails with integer for column position ### Describe the bug Unlike pandas-like and polars, pyarrow backend fails to return a series when sliced with column position integer ### Steps or code to reproduce the bug ```py import narwhals as nw import pandas as pd import polars as pl impo...
diff --git a/narwhals/_arrow/dataframe.py b/narwhals/_arrow/dataframe.py index 7029cc0e..e3ec3da7 100644 --- a/narwhals/_arrow/dataframe.py +++ b/narwhals/_arrow/dataframe.py @@ -9,6 +9,7 @@ from typing import Sequence from typing import overload from narwhals._arrow.utils import broadcast_series +from narwhals._ar...
narwhals-dev__narwhals-994
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "narwhals/_arrow/dataframe.py:ArrowDataFrame.__getitem__" ], "edited_modules": [ "narwhals/_arrow/dataframe.py:ArrowDataFrame" ] }, "file": "narwhals/_arrow/dataframe.py...
narwhals-dev/narwhals
9353ef9f681f032feee777fabbb8db8ae98aa79d
[Bug]: Subsetting 0 rows or 0 columns returns returns unexpected behavior ### Describe the bug Unexpected row subset behaviors: * When performing an empty row subset on pandas, it returns an empty column data frame. This does not happen with polars * When performing an empty row and an column slice subset on both ...
diff --git a/.github/workflows/check_docs_build.yml b/.github/workflows/check_docs_build.yml index c59e67f4..1602bff4 100644 --- a/.github/workflows/check_docs_build.yml +++ b/.github/workflows/check_docs_build.yml @@ -19,7 +19,7 @@ jobs: with: python-version: ${{ matrix.python-version }} - n...
natasha__yargy-46
[ { "changes": { "added_entities": [ "yargy/interpretation/attribute.py:FactAttribute.const", "yargy/interpretation/attribute.py:FactAttribute.custom" ], "added_modules": null, "edited_entities": [ "yargy/interpretation/attribute.py:prepare_normalized", "yar...
natasha/yargy
486a17df07ad1615b7a8d6ef2a4bfe3a39d30340
Allow define custom value in interpretation rules Like this ```python { 'interpretation': { 'attribute': Object.attribute, 'value': SomeEnum.value, } } ```
diff --git a/yargy/interpretation/attribute.py b/yargy/interpretation/attribute.py index 6f6c264..ca320c6 100644 --- a/yargy/interpretation/attribute.py +++ b/yargy/interpretation/attribute.py @@ -55,16 +55,6 @@ class FactAttributeBase(Record): ) -def prepare_normalized(attribute, item): - if item is no...
nathan-v__aws_okta_keyman-212
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "aws_okta_keyman/okta.py:Okta.mfa_wait_loop" ], "edited_modules": [ "aws_okta_keyman/okta.py:Okta" ] }, "file": "aws_okta_keyman/okta.py" } ]
nathan-v/aws_okta_keyman
2d6da191a1ecb9b53fb7f5b29c7b890f798fe88f
Support for 3-number challenge when Okta Verify mobile app forces extra verification **Is your feature request related to a problem? Please describe.** When attempting to use aws_okta_keyman, Okta Verify for Android determines that it is an "unusual" login attempt, and forces an additional layer of verification with t...
diff --git a/aws_okta_keyman/okta.py b/aws_okta_keyman/okta.py index fa55911..a5762d5 100644 --- a/aws_okta_keyman/okta.py +++ b/aws_okta_keyman/okta.py @@ -378,10 +378,24 @@ class Okta: otherwise None """ try: + message = "Waiting for MFA success..." while ret["st...
nathan-v__aws_okta_keyman-72
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "aws_okta_keyman/aws.py:Session.available_roles" ], "edited_modules": [ "aws_okta_keyman/aws.py:Session" ] }, "file": "aws_okta_keyman/aws.py" } ]
nathan-v/aws_okta_keyman
9dee43b01e5650f12ba9fdc33ce911a10fa723ca
Role Selection In Windows I've attached the response i've received while choosing a role, the issue in this is it picks the wrong role , in the below output i chooses role 2 which is ideally **aws-exp-exp3** but it assumed the different one please check 12:56:37 (INFO) AWS Okta Keyman πŸ” v0.8.3 Password: 12:56:...
diff --git a/aws_okta_keyman/aws.py b/aws_okta_keyman/aws.py index 80484db..91e961b 100644 --- a/aws_okta_keyman/aws.py +++ b/aws_okta_keyman/aws.py @@ -179,7 +179,6 @@ class Session(object): multiple_accounts = False first_account = '' formatted_roles = [] - i = 0 for role in...
nathandines__SPF2IP-3
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "SPF2IP.py:dns_request_unicode" ], "edited_modules": [ "SPF2IP.py:dns_request_unicode" ] }, "file": "SPF2IP.py" }, { "changes": { "added_entities": null, ...
nathandines/SPF2IP
7e3593a6f322c39a02c1c0f4a108b046ec6c1a20
Broken on 3.6 The current code always returns an empty answer on Python 3.6. This fixes it for me: ``` diff --git a/SPF2IP.py b/SPF2IP.py index e6210f3..84683ff 100644 --- a/SPF2IP.py +++ b/SPF2IP.py @@ -34,7 +34,7 @@ def dns_request_unicode(hostname,record_type,*args,**kwargs): value = value.__str__(...
diff --git a/SPF2IP.py b/SPF2IP.py index e6210f3..b95903e 100644 --- a/SPF2IP.py +++ b/SPF2IP.py @@ -29,14 +29,22 @@ def dns_request_unicode(hostname,record_type,*args,**kwargs): value = value.decode('utf-8') output.append(value) elif record_type == "MX": - value = entry.exchange - if typ...
nats-io__nats.py-488
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "nats/aio/client.py:Client.connect" ], "edited_modules": [ "nats/aio/client.py:Client" ] }, "file": "nats/aio/client.py" } ]
nats-io/nats.py
caaf42818eb80e180e40ae2225b49b9c47fd8b1d
Nats client not respecting the username and password provided in server string if server has "no_auth_user" configured ### What version were you using? nats-server: v2.9.21 Using commit `caaf42818eb80e180e40ae2225b49b9c47fd8b1d` which shows `2.3.1` ### What environment was the server running in? Mac M1 ### Is this...
diff --git a/nats/aio/client.py b/nats/aio/client.py index a58fd2f..7db96f6 100644 --- a/nats/aio/client.py +++ b/nats/aio/client.py @@ -451,7 +451,14 @@ class Client: if tls_hostname: self.options['tls_hostname'] = tls_hostname - if user or password or token: + # Check if the user...
nats-io__nats.py-607
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": null, "edited_modules": [ "nats/js/api.py:StreamConfig" ] }, "file": "nats/js/api.py" }, { "changes": { "added_entities": null, "added_modules": null, "edited_...
nats-io/nats.py
fff953079bdb69b9353c1782f00cb099505472a9
Passing wrong stream name to `add_stream` throws `errors.TimeoutError` This may be similar to #305 and/or #437. Following code: ```python import nats import pytest @pytest.mark.asyncio async def test_js_wrong_name(): nc = await nats.connect("localhost") js = nc.jetstream() await js.add_stream(n...
diff --git a/nats/js/api.py b/nats/js/api.py index 48c3836..3205b02 100644 --- a/nats/js/api.py +++ b/nats/js/api.py @@ -276,6 +276,7 @@ class StreamConfig(Base): max_msgs: Optional[int] = None max_bytes: Optional[int] = None discard: Optional[DiscardPolicy] = DiscardPolicy.OLD + discard_new_per_subje...
nats-io__nats.py-615
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "nats/js/client.py:JetStreamContext.subscribe" ], "edited_modules": [ "nats/js/client.py:JetStreamContext" ] }, "file": "nats/js/client.py" } ]
nats-io/nats.py
a63d3c4a47b08a5cf310d6b51c395cb7d691ea98
JetstreamContext.subscribe() ignores deliver_subject from config argument ### Observed behavior When `.subscribe()` of `JetstreamContext` is called, and the specified consumer does not exist, the client creates a consumer based on the given config object. However, attribute deliver_subject of config object is ignored,...
diff --git a/nats/js/client.py b/nats/js/client.py index bc951be..7958dbb 100644 --- a/nats/js/client.py +++ b/nats/js/client.py @@ -414,9 +414,10 @@ class JetStreamContext(JetStreamManager): if inactive_threshold: config.inactive_threshold = inactive_threshold - # Create inbo...
ncclient__ncclient-314
[ { "changes": { "added_entities": [ "ncclient/manager.py:_extract_device_params", "ncclient/manager.py:_extract_manager_params" ], "added_modules": [ "ncclient/manager.py:_extract_device_params", "ncclient/manager.py:_extract_manager_params" ], "edite...
ncclient/ncclient
2b75f2c6a06bd2a5d1be67b01bb65c5ffd2e2d7a
connect_ssh timeout parameter used for contradicting purposes The `timeout` kwd parameter of `manager.connect_ssh` ends up being used for two rather contradicting purposes: 1. It is passed as a kwd to `transport.SSHSession.connect` , where it serves as a connection timeout. This matches the documentation of the manage...
diff --git a/ncclient/manager.py b/ncclient/manager.py index 3618291..09a8aaf 100644 --- a/ncclient/manager.py +++ b/ncclient/manager.py @@ -89,32 +89,47 @@ def make_device_handler(device_params): return handler_obj +def _extract_device_params(kwds): + if "device_params" in kwds: + device_params = kw...
ncclient__ncclient-319
[ { "changes": { "added_entities": [ "ncclient/manager.py:Manager.huge_tree" ], "added_modules": null, "edited_entities": [ "ncclient/manager.py:Manager.__init__", "ncclient/manager.py:Manager.execute" ], "edited_modules": [ "ncclient/manager.py:...
ncclient/ncclient
f7b0ff9178369969d0396e4b05c1d182c4423f10
Exception when NETCONF response contains an XML text node > 10,000,000 bytes By default, libxml2 >= 2.7 restricts XML text nodes to a maximum of 10,000,000 bytes (~9.5Mbytes). In turn, lxml uses this libxml2 default, but offers the `huge_tree` option: http://lxml.de/parsing.html#parser-options If a NETCONF response...
diff --git a/docs/source/manager.rst b/docs/source/manager.rst index 5aef64f..27dff7c 100644 --- a/docs/source/manager.rst +++ b/docs/source/manager.rst @@ -38,6 +38,8 @@ Presence of capabilities is verified to the extent possible, and you can expect .. autoclass:: Manager + .. autoattribute:: HUGE_TREE_DEFAULT...
ncclient__ncclient-397
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "ncclient/operations/util.py:build_filter" ], "edited_modules": [ "ncclient/operations/util.py:build_filter" ] }, "file": "ncclient/operations/util.py" } ]
ncclient/ncclient
790c1e9eecf07bd67d1a86a5e579827a9f6dad9d
get() operation not accepting multiple subtree filters I am trying to get RPC reply of multiple sub trees at once via get() operation as below but its giving me an error. ```python getfacts=''' <host-names xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-shellutil-cfg"/> <system-time xmlns="http://cisco.com/ns/...
diff --git a/ncclient/operations/util.py b/ncclient/operations/util.py index bb03502..b760fd1 100755 --- a/ncclient/operations/util.py +++ b/ncclient/operations/util.py @@ -56,6 +56,10 @@ def build_filter(spec, capcheck=None): rep.append(to_ele(criteria)) else: raise OperationError("I...
ncclient__ncclient-404
[ { "changes": { "added_entities": [ "ncclient/xml_.py:parent_ns" ], "added_modules": [ "ncclient/xml_.py:parent_ns" ], "edited_entities": null, "edited_modules": null }, "file": "ncclient/xml_.py" } ]
ncclient/ncclient
1f8697150508175aa6a7452e4f035ed7de38ae5f
Let sub_ele inherit parent namespace per default sub_ele defaults to using the `urn:ietf:params:xml:ns:netconf:base:1.0` namespace. Further, unlike new_ele for which there is a new_ele_ns that also accepts a namespace, there is no such equivalent for sub_ele. How am I supposed to add subelement in my namespace of ch...
diff --git a/ncclient/xml_.py b/ncclient/xml_.py index 84dbff0..8e81c81 100644 --- a/ncclient/xml_.py +++ b/ncclient/xml_.py @@ -223,11 +223,15 @@ class NCElement(object): parser=self.__parser) return self.__root +def parent_ns(node): + if node.prefix: + retu...
ncclient__ncclient-405
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "ncclient/operations/util.py:build_filter" ], "edited_modules": [ "ncclient/operations/util.py:build_filter" ] }, "file": "ncclient/operations/util.py" }, { "cha...
ncclient/ncclient
70d2a3287361d50bce6e867ba6f31b9aa16dc357
Question: how to pass namespace defintion to xpath filter? Hi, I would like to pass an xpath filter to the `get` method. It should be the equivalent of this XML request: ```xml <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="28"> <get> <filter type="subtree"> <turing-machine xmlns...
diff --git a/ncclient/operations/util.py b/ncclient/operations/util.py index b1bd733..0d1bb38 100755 --- a/ncclient/operations/util.py +++ b/ncclient/operations/util.py @@ -49,10 +49,12 @@ def build_filter(spec, capcheck=None): type = None if isinstance(spec, tuple): type, criteria = spec - re...
ncclient__ncclient-412
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "ncclient/operations/edit.py:EditConfig.request" ], "edited_modules": [ "ncclient/operations/edit.py:EditConfig" ] }, "file": "ncclient/operations/edit.py" }, { ...
ncclient/ncclient
3255200588c27efbd12e30a5d0ab4f7ad003dd3f
Need some improvements in class EditConfig Hi @einarnn, Lately, I've been digging into the code, and found some improvements in class `EditConfig` . 1). the args in the method `request()` don't check their validity before use. 2). the parameter `test_option` is different between [RFC 4741](https://tools.ietf.org/htm...
diff --git a/ncclient/operations/edit.py b/ncclient/operations/edit.py index 05d7e05..8cfda3f 100644 --- a/ncclient/operations/edit.py +++ b/ncclient/operations/edit.py @@ -39,7 +39,7 @@ class EditConfig(RPC): *default_operation* if specified must be one of { `"merge"`, `"replace"`, or `"none"` } - ...
ncclient__ncclient-418
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "ncclient/operations/util.py:build_filter" ], "edited_modules": [ "ncclient/operations/util.py:build_filter" ] }, "file": "ncclient/operations/util.py" } ]
ncclient/ncclient
1e767daffa8ccb6256f315433ab8db50ee48380d
Release 0.6.8 xpath filter incompatible with previous releases The following code used to work in 0.6.7 and earlier, ``` from ncclient import manager path = '/a/b/c' with manager.connect(...) as m: reply = m.get('xpath', path) ``` Now this code throws an error ``` File "test-netconf.py", line 7, in...
diff --git a/ncclient/operations/util.py b/ncclient/operations/util.py index 0d1bb38..b8512f5 100755 --- a/ncclient/operations/util.py +++ b/ncclient/operations/util.py @@ -50,9 +50,13 @@ def build_filter(spec, capcheck=None): if isinstance(spec, tuple): type, criteria = spec if type == "xpath": ...
ncclient__ncclient-452
[ { "changes": { "added_entities": [ "ncclient/devices/default.py:DefaultDeviceHandler.handle_reply_parsing_error" ], "added_modules": null, "edited_entities": null, "edited_modules": [ "ncclient/devices/default.py:DefaultDeviceHandler" ] }, "file": "ncc...
ncclient/ncclient
ea7bcd07ae476366361a1778df37b428225312a0
get_schema fails to fetch yang schema for junos RPC response for `get-schema('junos-common-types')` https://gist.github.com/ganeshrn/02d20623cd17f6cfac61f3210066cde5 As the rpc response root node does not have namespace `"urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring"` the [root.find()](https://github.com/n...
diff --git a/ncclient/devices/default.py b/ncclient/devices/default.py index e292227..2a701e0 100644 --- a/ncclient/devices/default.py +++ b/ncclient/devices/default.py @@ -222,6 +222,16 @@ class DefaultDeviceHandler(object): def handle_connection_exceptions(self, sshsession): return False + def hand...
ncclient__ncclient-485
[ { "changes": { "added_entities": [ "ncclient/devices/default.py:DefaultDeviceHandler.reply_parsing_error_transform" ], "added_modules": null, "edited_entities": [ "ncclient/devices/default.py:DefaultDeviceHandler.handle_reply_parsing_error" ], "edited_modules"...
ncclient/ncclient
7898dd9ec3404265418b05ef99e50bd670966084
TypeError: __init__() missing 1 required positional argument: 'device_handler' Why an optional parameter was added in between (and not in the end) https://github.com/ncclient/ncclient/pull/452/files#diff-9f0edad4d5a881f4165c86a0b3a9116fe67d9b7cdda2d9a888fb98bcb09311feR147 also as device handler is an optional par...
diff --git a/ncclient/devices/default.py b/ncclient/devices/default.py index f9107b4..bac3195 100644 --- a/ncclient/devices/default.py +++ b/ncclient/devices/default.py @@ -242,16 +242,16 @@ class DefaultDeviceHandler(object): def handle_connection_exceptions(self, sshsession): return False - def han...
nebari-dev__jupyterlab-gallery-22
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "jupyterlab_gallery/handlers.py:GalleryHandler.get", "jupyterlab_gallery/handlers.py:PullHandler.post" ], "edited_modules": [ "jupyterlab_gallery/handlers.py:GalleryHandler", ...
nebari-dev/jupyterlab-gallery
63b55cb380f802c97e508cf345132a1572fefb6b
Improve the design of the gallery tiles The gallery tiles do not look great yet: - when the icons are of varied sizes, the tiles are of different dimensions - the buttons are taking up a lot of space One idea to solve the second point is to show the buttons on hover: ![buttons-on-hover](https://github.com/nebar...
diff --git a/jupyterlab_gallery/handlers.py b/jupyterlab_gallery/handlers.py index ab11de8..c02c568 100644 --- a/jupyterlab_gallery/handlers.py +++ b/jupyterlab_gallery/handlers.py @@ -27,6 +27,7 @@ class GalleryHandler(BaseHandler): { "title": self.gallery_manager.title, ...
nebari-dev__jupyterlab-gallery-5
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "jupyterlab_gallery/handlers.py:ExhibitsHandler.get" ], "edited_modules": [ "jupyterlab_gallery/handlers.py:ExhibitsHandler" ] }, "file": "jupyterlab_gallery/handlers.py...
nebari-dev/jupyterlab-gallery
a53b9616b471e5d0dbd567c9dc2f37da1daff583
Implement placing examples in the launcher To make the examples visible to users potentially the best location would be a collapsible section in the `jupyterlab-new-launcher` (when installed). - This could be done by expanding the `ILauncher.IItemOptions` to include a custom `render()` method, and creating a section...
diff --git a/jupyterlab_gallery/handlers.py b/jupyterlab_gallery/handlers.py index c2b5144..d5f3761 100644 --- a/jupyterlab_gallery/handlers.py +++ b/jupyterlab_gallery/handlers.py @@ -110,7 +110,7 @@ class ExhibitsHandler(APIHandler): prepare_exhibit(exhibit_config, exhibit_id=i) ...
nengo__nengo-loihi-286
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "nengo_loihi/builder/split_blocks.py:split_block" ], "edited_modules": [ "nengo_loihi/builder/split_blocks.py:split_block" ] }, "file": "nengo_loihi/builder/split_blocks...
nengo/nengo-loihi
023e3ae9e1d7c54899dca0f983288b50463e0299
Error splitting probe across blocks ```import numpy as np import tensorflow as tf import nengo import nengo_dl import nengo_loihi inp = tf.keras.Input(shape=(28, 28, 1)) conv0 = tf.keras.layers.Conv2D( filters=3, strides=1, kernel_size=1, activation=tf.nn.relu, use_bias=False, )(in...
diff --git a/CHANGES.rst b/CHANGES.rst index adb146f..511e4b6 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -129,6 +129,9 @@ Release history (`#284 <https://github.com/nengo/nengo-loihi/pull/284>`__) - Fixed bug when connecting to a single neuron ensemble with a single scalar weight. (`#287 <https://github.com/n...
neo4j__neo4j-python-driver-1002
[ { "changes": { "added_entities": [ "src/neo4j/time/__init__.py:Duration.__reduce__", "src/neo4j/time/__init__.py:Duration._restore", "src/neo4j/time/__init__.py:Date.__reduce__", "src/neo4j/time/__init__.py:Date._restore", "src/neo4j/time/__init__.py:Time.__init__",...
neo4j/neo4j-python-driver
3b7c790878168d0a0368ddeda26d75b59c6b1eef
TypeError when serializing DateTime object with pickle # My Environment Python Version: Python 3.10.12 Driver Version: 5.15.dev0 Operating System: Pop!_OS 22.04 LTS # Steps to reproduce ``` import pickle expected = DateTime(2023, 12, 7, 12, 34, 56, 7890) dump = pickle.dumps(expected) actual = pickle.loads(...
diff --git a/src/neo4j/time/__init__.py b/src/neo4j/time/__init__.py index 009f516f..de01deea 100644 --- a/src/neo4j/time/__init__.py +++ b/src/neo4j/time/__init__.py @@ -574,12 +574,17 @@ class Duration(t.Tuple[int, int, int, int], # type: ignore[misc] """""" return self.iso_format() - def __co...
neo4j__neo4j-python-driver-498
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "neo4j/spatial/__init__.py:Point.__new__" ], "edited_modules": [ "neo4j/spatial/__init__.py:Point" ] }, "file": "neo4j/spatial/__init__.py" } ]
neo4j/neo4j-python-driver
48b989955e85ff718da4e604f029275a860ab0cb
Crash when using spatial type as parameters Hi folks! I can't seem to get the spatial type working, just getting a crash (stack trace attached). - Neo4j version: Enterprise 4.2.1 - Neo4j Mode: Single instance - Python 3.9 - Driver version: driver 4.2.1 - Operating system: Ubuntu 20.04 - **Steps to reprodu...
diff --git a/neo4j/spatial/__init__.py b/neo4j/spatial/__init__.py index f7085fd4..36e8d66f 100644 --- a/neo4j/spatial/__init__.py +++ b/neo4j/spatial/__init__.py @@ -53,7 +53,7 @@ class Point(tuple): srid = None def __new__(cls, iterable): - return tuple.__new__(cls, iterable) + return tuple....
neo4j__neo4j-python-driver-510
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "neo4j/spatial/__init__.py:Point.__new__" ], "edited_modules": [ "neo4j/spatial/__init__.py:Point" ] }, "file": "neo4j/spatial/__init__.py" } ]
neo4j/neo4j-python-driver
48b989955e85ff718da4e604f029275a860ab0cb
Prevent Deprecation Warning to users ## User get DeprecationWarnings - Operating system: Windows 10 Run install and run [nox](https://nox.thea.codes/en/stable/) on attached archive [example_python.zip](https://github.com/neo4j/neo4j-python-driver/files/5842343/example_python.zip) - Expected behavior pylint ...
diff --git a/neo4j/spatial/__init__.py b/neo4j/spatial/__init__.py index f7085fd4..36e8d66f 100644 --- a/neo4j/spatial/__init__.py +++ b/neo4j/spatial/__init__.py @@ -53,7 +53,7 @@ class Point(tuple): srid = None def __new__(cls, iterable): - return tuple.__new__(cls, iterable) + return tuple....
neo4j__neo4j-python-driver-551
[ { "changes": { "added_entities": [ "neo4j/meta.py:deprecation_warn" ], "added_modules": [ "neo4j/meta.py:deprecation_warn" ], "edited_entities": [ "neo4j/meta.py:deprecated" ], "edited_modules": [ "neo4j/meta.py:deprecated" ] },...
neo4j/neo4j-python-driver
1ae4a6bcd7503c4df9202ef005ff4b10ae6b65a0
Microsecond bug in neo4j.time.DateTime.to_native() Converting a `neo4j.time.DateTime` to the built-in `datetime.datetime` using your `to_native` method will sometimes give wrong microseconds. I suspect this is a rounding error related somehow to this line: https://github.com/neo4j/neo4j-python-driver/blob/f6b0254a1f0d...
diff --git a/neo4j/meta.py b/neo4j/meta.py index d9b0ae87..127caf70 100644 --- a/neo4j/meta.py +++ b/neo4j/meta.py @@ -34,6 +34,11 @@ def get_user_agent(): return template.format(*fields) +def deprecation_warn(message): + from warnings import warn + warn(message, category=DeprecationWarning, stacklevel=2...
neo4j__neo4j-python-driver-803
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "neo4j/io/__init__.py:IOPool._acquire_new_later" ], "edited_modules": [ "neo4j/io/__init__.py:IOPool" ] }, "file": "neo4j/io/__init__.py" } ]
neo4j/neo4j-python-driver
2ecc4902b6047627fb5bd00c8efa1461d96bd9b2
Async driver keeping connections from pool open? I encountered a new issue with the Async driver version 5.0.0a2. The error states: ERROR in app: Exception on request POST /recommend_contact Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/quart/app.py", line 1489, in handle_re...
diff --git a/neo4j/io/__init__.py b/neo4j/io/__init__.py index fb71d5ef..862895d7 100644 --- a/neo4j/io/__init__.py +++ b/neo4j/io/__init__.py @@ -756,9 +756,9 @@ class IOPool: + self.connections_reservations[address]) can_create_new_connection = (infinite_pool_size ...
neo4j__neo4j-python-driver-804
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "neo4j/_async/io/_pool.py:AsyncIOPool._acquire_new_later" ], "edited_modules": [ "neo4j/_async/io/_pool.py:AsyncIOPool" ] }, "file": "neo4j/_async/io/_pool.py" }, { ...
neo4j/neo4j-python-driver
8971b295e376c3323423f553b31909d6492a6aee
Async driver keeping connections from pool open? I encountered a new issue with the Async driver version 5.0.0a2. The error states: ERROR in app: Exception on request POST /recommend_contact Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/quart/app.py", line 1489, in handle_re...
diff --git a/neo4j/_async/io/_pool.py b/neo4j/_async/io/_pool.py index d0a9acd4..f61ebd46 100644 --- a/neo4j/_async/io/_pool.py +++ b/neo4j/_async/io/_pool.py @@ -23,7 +23,6 @@ from collections import ( defaultdict, deque, ) -from contextlib import asynccontextmanager from logging import getLogger from ran...
neogeny__TatSu-100
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "tatsu/bootstrap.py:EBNFBootstrapParser._directive_", "tatsu/bootstrap.py:EBNFBootstrapParser._regex_" ], "edited_modules": [ "tatsu/bootstrap.py:EBNFBootstrapParser" ] ...
neogeny/TatSu
617a979370cf401d80667320b3b572b535f5b07c
Left recursion bug when not at top level? I have the following grammar that purports to parse declarations of the form: `<type> <name>`. The `type` is either an identifier, or an array of `type`, so `int x` and `int[] x` and `int[][] x` would be valid declarations. ```py import tatsu grammar = r""" identifier =...
diff --git a/README.md b/README.md index 8aa1d6e..cd6ced6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ [![license](https://img.shields.io/badge/license-BSD-blue.svg)](https://raw.githubusercontent.com/neogeny/tatsu/master/LICENSE.txt) [![pyversions](https://img.shields.io/pypi/pyversions/tatsu.svg)](https://...
neogeny__TatSu-101
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "tatsu/bootstrap.py:EBNFBootstrapParser._directive_" ], "edited_modules": [ "tatsu/bootstrap.py:EBNFBootstrapParser" ] }, "file": "tatsu/bootstrap.py" }, { "chan...
neogeny/TatSu
0b8b13530e9da7a6979aaa038b80316893e25f94
Allow False as a value for @@whitespace Currently using this inside my grammar: ``` @@whitespace :: /(?!)/ ``` which doesn't match anything. ``` @@whitespace :: False ``` would be more descriptive and probably more performant. `True` would set it to the default value. Alternatively it could accept a string and...
diff --git a/grammar/tatsu.ebnf b/grammar/tatsu.ebnf index 6ff697e..f017615 100644 --- a/grammar/tatsu.ebnf +++ b/grammar/tatsu.ebnf @@ -25,9 +25,13 @@ directive = '@@' !'keyword' ~ ( - name:('comments' | 'eol_comments' | 'whitespace') ~ + name:('comments' | 'eol_comments') ~ ...
neogeny__TatSu-102
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "tatsu/buffering.py:Buffer.line_info" ], "edited_modules": [ "tatsu/buffering.py:Buffer" ] }, "file": "tatsu/buffering.py" } ]
neogeny/TatSu
5861760d7e0fb5bdd7d9639faac8a512dacc4c41
Error message doesn't contains line on witch error happens ```python import tatsu GRAMMAR_TEXT = """ start = ATTRIBUTE operator value ; ATTRIBUTE = /[A-Za-z]+/; operator = '=' | '!=' ; value = NUMBER ; NUMBER = /[0-9]+/ ; """ def parse(data): with open('gr.py', 'w') as fd...
diff --git a/tatsu/buffering.py b/tatsu/buffering.py index cba470c..4ab6cf7 100644 --- a/tatsu/buffering.py +++ b/tatsu/buffering.py @@ -340,9 +340,7 @@ class Buffer(object): if pos is None: pos = self._pos - if pos >= len(self._line_cache): - return LineInfo(self.filename, sel...
neogeny__TatSu-103
[ { "changes": { "added_entities": [ "tatsu/grammars.py:Rule._add_defined_attributes" ], "added_modules": null, "edited_entities": [ "tatsu/grammars.py:Token._first", "tatsu/grammars.py:Pattern._first", "tatsu/grammars.py:Special._first", "tatsu/gram...
neogeny/TatSu
27f5a1a90578d898a07d347d8df547bb52b912ad
ModelBuilderSemantics doesn't include optional attributes If I have a rule that with an optional named component, that component shows up as `None` when using the AST, but is missing from the model class when using `ModelBuilderSemantics`, see the code below: ```py import tatsu from tatsu.model import ModelBuilder...
diff --git a/tatsu/grammars.py b/tatsu/grammars.py index 8843994..aef1e77 100644 --- a/tatsu/grammars.py +++ b/tatsu/grammars.py @@ -296,7 +296,7 @@ class Token(Model): return ctx._token(self.token) def _first(self, k, f): - return set([(self.token,)]) + return {(self.token,)} def _...
neogeny__TatSu-137
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "tatsu/codegen/python.py:Rule.render_fields" ], "edited_modules": [ "tatsu/codegen/python.py:Rule", "tatsu/codegen/python.py:Grammar" ] }, "file": "tatsu/codegen...
neogeny/TatSu
22e741a684849aaebe9d3eb1c9a05b74605dfb2c
Simplify ParseContext `contextxs.ParseContext` still carries inneficiencies and complications from its original versions: * Although the `ast` and `cst` stacks were merged, the `cut` and `pos` stacks remain separate, when there could be a single stack to hold the state at relevant points in the parse: rules, and opt...
diff --git a/.pylintrc b/.pylintrc index 280bbe7..0fd8660 100644 --- a/.pylintrc +++ b/.pylintrc @@ -145,7 +145,7 @@ confidence= # comprehension-escape disable=C0102, C0103, C0111, C0122, C0123, - C0301, C0330, + C0301, C0321, C0330, C0411, C0412, C0415, C1801, E1101,...
neogeny__TatSu-183
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "tatsu/contexts.py:ParseContext.parse", "tatsu/contexts.py:ParseContext._check_name" ], "edited_modules": [ "tatsu/contexts.py:ParseContext" ] }, "file": "tatsu/...
neogeny/TatSu
7e3a58843d8a70b6dddaf70dfbcb2abaecad07cb
Ignorecase needs uppercase keywords when reserving Reserving keywords and ignoring case does not work as expected: ``` @@ignorecase :: True @@keyword :: if @name rule = /\w+/ if_exp $ ; if_exp = 'if' /\d/ ; ``` **The 'if' is parsed as the rule while it should error.** This is because in [contexts.py](...
diff --git a/.pylintrc b/.pylintrc index 75a1593..280bbe7 100644 --- a/.pylintrc +++ b/.pylintrc @@ -10,7 +10,7 @@ extension-pkg-whitelist= # Add files or directories to the blacklist. They should be base names, not # paths. -ignore=CVS,bootstrap.py,model.py +ignore=CVS,bootstrap.py,model.py,tmp # Add files or d...
neogeny__TatSu-221
[ { "changes": { "added_entities": [ "tatsu/bootstrap.py:EBNFBootstrapParser._option_", "tatsu/bootstrap.py:EBNFBootstrapSemantics.option" ], "added_modules": null, "edited_entities": [ "tatsu/bootstrap.py:EBNFBootstrapBuffer.__init__", "tatsu/bootstrap.py:E...
neogeny/TatSu
69b787dca1cf5969192e17f1d195fc84e528436b
all names in the successful option should be present in the AST related to #199 Given the grammar below, users expect if the first option in the choice for `expr_range` parses, then both `from` and `to` will be present in the resulting AST, and that is not the current behavior in TatSu. Some matching strings are "...
diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 1ffced3..c39225e 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -14,8 +14,11 @@ The format of this *Change Log* is inspired by `keeapachangelog.org`_. --------------- .. _`X.Y.Z`: https://github.com/apalala/tatsu/compare/v5.6.1...master +* Drop support for Pytho...
neogeny__TatSu-265
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": null, "edited_modules": null }, "file": "examples/calc/calc.py" }, { "changes": { "added_entities": null, "added_modules": null, "edited_entities": null, "edited_modul...
neogeny/TatSu
85473204ac7f0174947342d2d3d74aeff7a0b63c
Generated semantics use old syntax for super() in __init__()
diff --git a/.pylintrc b/.pylintrc index bb78ebb..1f1165a 100644 --- a/.pylintrc +++ b/.pylintrc @@ -165,7 +165,7 @@ disable= # c-extension-no-member, # I1101 # literal-comparison, # R0123 # comparison-with-itself, # R0124 - no-self-use, # R0201 + # no-self-use, # R0201 / moved to extension ...
neogeny__TatSu-268
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": null, "edited_modules": null }, "file": "examples/calc/calc.py" }, { "changes": { "added_entities": null, "added_modules": null, "edited_entities": null, "edited_modul...
neogeny/TatSu
85473204ac7f0174947342d2d3d74aeff7a0b63c
Calling `str()` on a model containing non-JSON-representable types raises exception Having the `__str__` method of `tatsu.objectmodel.Node` returning a JSON representation is reasonable, however it it problematic for parsers that return an AST containing objects that are not supported by `json.dumps()` notably `datetim...
diff --git a/.pylintrc b/.pylintrc index bb78ebb..1f1165a 100644 --- a/.pylintrc +++ b/.pylintrc @@ -165,7 +165,7 @@ disable= # c-extension-no-member, # I1101 # literal-comparison, # R0123 # comparison-with-itself, # R0124 - no-self-use, # R0201 + # no-self-use, # R0201 / moved to extension ...
neogeny__TatSu-275
[ { "changes": { "added_entities": [ "tatsu/walkers.py:NodeWalkerMeta.__new__", "tatsu/walkers.py:NodeWalker.__init__" ], "added_modules": [ "tatsu/walkers.py:NodeWalkerMeta" ], "edited_entities": [ "tatsu/walkers.py:NodeWalker.__new__", "tatsu...
neogeny/TatSu
a7e62870858a68a07b4043c4f31ac491e503eb37
Unusual use of `__new__()` in `NodeWalker` Hunting for old-style `super()` calls I bumped into the `__new__()` method of the `NodeWalker` class: ```python class NodeWalker: def __new__(cls, *args, **kwargs): cls._walker_cache = {} return super(NodeWalker, cls).__new__(cls) ``` As the class do...
diff --git a/tatsu/walkers.py b/tatsu/walkers.py index e236501..12ccc63 100644 --- a/tatsu/walkers.py +++ b/tatsu/walkers.py @@ -8,10 +8,18 @@ from tatsu.objectmodel import Node from tatsu.util import is_list -class NodeWalker: - def __new__(cls, *args, **kwargs): - cls._walker_cache = {} - return...
neogeny__TatSu-276
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "tatsu/ast.py:AST.__reduce__" ], "edited_modules": [ "tatsu/ast.py:AST" ] }, "file": "tatsu/ast.py" } ]
neogeny/TatSu
91114b0bbcff7bd59e3e2163ec3b9c3bb3f5c3c8
tatsu.ast.AST objects don't pickle/unpickle properly Observe: ``` >>> from tatsu.ast import AST >>> a=AST(parseinfo=('Some parseinfo')) >>> a {'parseinfo': 'Some parseinfo'} >>> import pickle >>> pickle.loads(pickle.dumps(a)) {'parseinfo_': 'Some parseinfo'} ``` Note that after pickling/unpickling, the AS...
diff --git a/tatsu/ast.py b/tatsu/ast.py index 3d624c3..c67873e 100644 --- a/tatsu/ast.py +++ b/tatsu/ast.py @@ -98,7 +98,7 @@ class AST(dict): return True def __reduce__(self): - return (AST, (), None, None, iter(self.items())) + return (AST, (list(self.items()),)) def _safekey...
neogeny__TatSu-309
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "tatsu/contexts.py:ParseContext.memokey" ], "edited_modules": [ "tatsu/contexts.py:ParseContext" ] }, "file": "tatsu/contexts.py" }, { "changes": { "added_...
neogeny/TatSu
51d9f70b4cf068142e719ebeabaeab766e0a9b92
Surprising whitespace handling Given this example ```python import tatsu parser = tatsu.compile(r''' statement = 'SELECT' 'FROM' table $ ; table = name:id ; id = /[a-z]+/ ; ''') string = 'SELECT FROM foo' value = parser.parse(string, parseinfo=True) table = value[2] assert table['name'] == 'foo' p...
diff --git a/README.rst b/README.rst index eb57f92..683c25c 100644 --- a/README.rst +++ b/README.rst @@ -32,12 +32,10 @@ input, much like the `re`_ module does with regular expressions, or it can gener |TatSu| supports `left-recursive`_ rules in PEG_ grammars using the algorithm_ by *Laurent* and *Mens*. The generat...
neogeny__TatSu-32
[ { "changes": { "added_entities": [ "tatsu/contexts.py:ParseContext._forget", "tatsu/contexts.py:ParseContext._clear_recursion_errors" ], "added_modules": null, "edited_entities": [ "tatsu/contexts.py:ParseContext._is_recursive", "tatsu/contexts.py:ParseCon...
neogeny/TatSu
03c5c4fdbe0ad1a649a1c6a04913efc234122971
Parser drops part of input Grammar: ``` identifier = /\w+/ ; start = '{' start '}' | start '->' identifier | identifier ; ``` Input: ``` { size } test ``` Expected output: `['{', 'size', '}']` Actual output: `test` Removing the (left recursive) rule `start '->' identifier` fixes the problem.
diff --git a/tatsu/contexts.py b/tatsu/contexts.py index 6c79fcf..c5dfa78 100644 --- a/tatsu/contexts.py +++ b/tatsu/contexts.py @@ -14,6 +14,7 @@ from ._unicode_characters import ( ) from tatsu.util import notnone, ustr, prune_dict, is_list, info, safe_name from tatsu.util import left_assoc, right_assoc +from tatsu...
neogeny__TatSu-320
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "tatsu/contexts.py:ParseContext._append_cst", "tatsu/contexts.py:ParseContext._constant" ], "edited_modules": [ "tatsu/contexts.py:ParseContext" ] }, "file": "ta...
neogeny/TatSu
8584cd51224e7787f6ea8c46b1d0e4aff69b1f96
Literal ``None`` is interpreted as a string When using a construct like ``` null = 'null' value:`None` ; ``` `value` takes the string value `"None"` and not `None`. `` `None` ``is used in the Tatsu's EBNF grammar in a few places and I have the impression that it is meant to be the `None` object no the `"None"` str...
diff --git a/Makefile b/Makefile index c46b857..839260b 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,7 @@ pylint: mypy: - mypy --ignore-missing-imports . + mypy --ignore-missing-imports . --exclude dist clean: diff --git a/docs/syntax.rst b/docs/syntax.rst index 11095fe..6c8da02 100644 --- a/docs/syn...
neogeny__TatSu-35
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "tatsu/contexts.py:ParseContext._cut", "tatsu/contexts.py:ParseContext._forget" ], "edited_modules": [ "tatsu/contexts.py:ParseContext" ] }, "file": "tatsu/conte...
neogeny/TatSu
4dcfba04d700e858c2c3ae1fdb258e6d5bbce2ab
Another left recursion problem Grammar: ``` identifier = /\w+/ ; expr = mul | identifier ; mul = expr '*' identifier ; ``` Parsing `a * b` with the start rule `expr` gives the expected result: `['a', '*', 'b']`. But parsing with the start rule `mul` gives the following error: ``` Traceback (most recent call l...
diff --git a/docs/left_recursion.rst b/docs/left_recursion.rst index 615a5d1..8b16e61 100644 --- a/docs/left_recursion.rst +++ b/docs/left_recursion.rst @@ -16,3 +16,30 @@ Left recursion support is enabled by default in |TatSu|. To disable it for a par @@left_recursion :: False + +.. warning:: + + Not all l...
neogeny__TatSu-67
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "tatsu/codegen/python.py:Pattern.render_fields" ], "edited_modules": [ "tatsu/codegen/python.py:Pattern" ] }, "file": "tatsu/codegen/python.py" } ]
neogeny/TatSu
677e51bed96fd15ce689b76e6f60f7251975eff2
Generated Python code doesn't cope with multi-line regexs Consider: ``` myrule = /(?x) foo bar / $ ; ``` This generates: ``` self._pattern(r'(?x) \n foo\n bar\n') ``` Which will look for literal newlines in the string, rather than being ignored.
diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 06fc6e4..94de2dd 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -14,6 +14,10 @@ The format of this *Change Log* is inspired by `keeapachangelog.org`_. --------------- .. _X.Y.Z: https://github.com/apalala/tatsu/compare/v4.2.6...master +* `#66`_ Fix multiline (`(...
neogeny__TatSu-78
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "tatsu/bootstrap.py:EBNFBootstrapParser._directive_", "tatsu/bootstrap.py:EBNFBootstrapParser._special_", "tatsu/bootstrap.py:EBNFBootstrapParser._constant_", "tatsu/bootstrap.py:...
neogeny/TatSu
4a6d893c8755bcd06a322365b35c129d16543f60
ModelBuilderSemantics Subclassing ```ebnf start = expression $; expression = | addition | subtraction | number; addition::BinaryOp::Op = left:expression op:'+' ~ right:number; subtraction::BinaryOp::Op = left:expression op:'-' ~ right:number; number = /\d+/; ``` This triggers an exception: h...
diff --git a/docs/mini-tutorial.rst b/docs/mini-tutorial.rst index b32c62c..c73380c 100644 --- a/docs/mini-tutorial.rst +++ b/docs/mini-tutorial.rst @@ -305,7 +305,7 @@ Semantics for |TatSu| parsers are not specified in the grammar, but in a separat parser = tatsu.compile(grammar) ast = parser.parse( ...
neogeny__TatSu-83
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "tatsu/bootstrap.py:EBNFBootstrapParser._directive_", "tatsu/bootstrap.py:EBNFBootstrapParser._special_", "tatsu/bootstrap.py:EBNFBootstrapParser._constant_", "tatsu/bootstrap.py:...
neogeny/TatSu
4aa9636ab1a77a24a5b60eeb06575aee5cf20dd7
No boolean literals ``` `10` -> 10 `string` -> 'string' `'long string'` -> 'long string' `True` -> 'True' ``` Since number literals are passed on I would expect the same to happen for boolean literals, but instead they get converted to strings. The same happens for `None` as well. I can use 0 and 1 instead, but i...
diff --git a/grammar/tatsu.ebnf b/grammar/tatsu.ebnf index d087e40..3ea4896 100644 --- a/grammar/tatsu.ebnf +++ b/grammar/tatsu.ebnf @@ -378,7 +378,7 @@ token::Token literal = - string | raw_string | word | hex | float | int + string | raw_string | boolean | word | hex | float | int ; diff --git ...
neogeny__TatSu-97
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "tatsu/buffering.py:Buffer.__init__" ], "edited_modules": [ "tatsu/buffering.py:Buffer" ] }, "file": "tatsu/buffering.py" }, { "changes": { "added_entities...
neogeny/TatSu
9cae439febc26e686260a0a6c04e805f7f97a45c
@@nameguard not honored in simple grammar I am puzzled by this behavior: ``` from pprint import pprint from tatsu import parse GRAMMAR = """ sequence = {fingering}+ ; fingering = '1' | '2' | '3' | '4' | '5' | 'x' ; """ test = "22" ast = parse(GRAMMAR, test) pprint(ast) # Prints ['2', '2'] test = "xx...
diff --git a/tatsu/buffering.py b/tatsu/buffering.py index 571cc0c..abd303c 100644 --- a/tatsu/buffering.py +++ b/tatsu/buffering.py @@ -44,14 +44,13 @@ class Buffer(object): self.comments_re = comments_re self.eol_comments_re = eol_comments_re self.ignorecase = ignorecase - self.nameg...
neovasili__tflens-34
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "tflens/__main__.py:main" ], "edited_modules": [ "tflens/__main__.py:main" ] }, "file": "tflens/__main__.py" }, { "changes": { "added_entities": null, ...
neovasili/tflens
8de85543fed8503e823b64b112dbbb292fc90d04
[resources] Add filter resources by name support We need to be able to filter resources shown in a table by name field. The filter must be able to use regular expressions as the filter pattern.
diff --git a/README.md b/README.md index 4c1fad7..3b089dd 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,8 @@ optional arguments: according to the following pattern: bucket-name/tfstate-key -m FILTER_MODULE, --filter-module FILTER_MODULE Applies a regular expression to the module field in orde...
neovasili__tflens-35
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "tflens/__main__.py:main" ], "edited_modules": [ "tflens/__main__.py:main" ] }, "file": "tflens/__main__.py" }, { "changes": { "added_entities": null, ...
neovasili/tflens
8fed041deb04b1abef816991fe185a7c0821c5ee
[resources] Add filter resources by resource type support We need to be able to filter resources shown in a table by resource type field. The filter must be able to use regular expressions as the filter pattern.
diff --git a/README.md b/README.md index 3b089dd..b4b09a0 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,8 @@ optional arguments: Applies a regular expression to the module field in order to filter the resources list to output -n FILTER_NAME, --filter-name FILTER_NAME Applies a regular express...
neovasili__tflens-36
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "tflens/__main__.py:main" ], "edited_modules": [ "tflens/__main__.py:main" ] }, "file": "tflens/__main__.py" }, { "changes": { "added_entities": null, ...
neovasili/tflens
ba81fda814f0f1401a79f52365d9ba1d3ca5799d
[resources] Add filter resources by provider support We need to be able to filter resources shown in a table by provider field. The filter must be able to use regular expressions as the filter pattern.
diff --git a/README.md b/README.md index b4b09a0..5676c16 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,8 @@ optional arguments: Applies a regular expression to the name field in order to filter the resources list to output -t FILTER_TYPE, --filter-type FILTER_TYPE Applies a regular expressio...
neovasili__tflens-37
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "tflens/__main__.py:main" ], "edited_modules": [ "tflens/__main__.py:main" ] }, "file": "tflens/__main__.py" }, { "changes": { "added_entities": null, ...
neovasili/tflens
658445946b11c2776992bec4ae31e12e829a5136
[resources] Add filter resources by mode support We need to be able to filter resources shown in a table by mode field. The filter must be able to use regular expressions as the filter pattern.
diff --git a/README.md b/README.md index 5676c16..1c92c04 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,8 @@ optional arguments: Applies a regular expression to the type field in order to filter the resources list to output -p FILTER_PROVIDER, --filter-provider FILTER_PROVIDER Applies a regul...
netaddr__netaddr-225
[ { "changes": { "added_entities": [ "netaddr/eui/__init__.py:OUI.__hash__" ], "added_modules": null, "edited_entities": null, "edited_modules": [ "netaddr/eui/__init__.py:OUI" ] }, "file": "netaddr/eui/__init__.py" } ]
netaddr/netaddr
606a44b62ea7032f63e359aaaaabc0057e168890
OUI hashability # Summary `OUI` does not have a `__hash__` function. This prevents the use of `OUI` for keys. - Python Hash documentation [link](https://docs.python.org/3/reference/datamodel.html#object.__hash__) # Example - Break ``` from netaddr import OUI a = OUI("002272") try: set(a) except Type...
diff --git a/netaddr/eui/__init__.py b/netaddr/eui/__init__.py index 5639676..07bbdc3 100644 --- a/netaddr/eui/__init__.py +++ b/netaddr/eui/__init__.py @@ -100,6 +100,9 @@ class OUI(BaseIdentifier): else: raise NotRegisteredError('OUI %r not registered!' % (oui,)) + def __hash__(self): + ...
netromdk__vermin-173
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "vermin/source_visitor.py:SourceVisitor.__add_kwargs", "vermin/source_visitor.py:SourceVisitor.visit_keyword" ], "edited_modules": [ "vermin/source_visitor.py:SourceVisitor" ...
netromdk/vermin
a2229690af9c381768e1a173b7a74ca7d578e456
python 3.9 feature not detected: argparse.BooleanOptionalAction **Describe the bug** `argparse.BooleanOptionalAction` is a Python 3.9 feature, but vermin doesn't detect it. **To Reproduce** Example code: ```python3 #!/usr/bin/env python3 ret = subparser.add_parser("qemu") ret.add_argument("--efi", action=a...
diff --git a/vermin/source_visitor.py b/vermin/source_visitor.py index 26f5191..440563a 100644 --- a/vermin/source_visitor.py +++ b/vermin/source_visitor.py @@ -769,16 +769,17 @@ class SourceVisitor(ast.NodeVisitor): def __add_kwargs(self, function, keyword, line=None, col=None): if function in self.__user_defs...
netromdk__vermin-196
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": null, "edited_modules": null }, "file": "vermin/backports.py" }, { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "vermin/rules.py:...
netromdk/vermin
5824cc0036fd71946e2cfff1ba65ceddbeae5f56
False positive when using backported zoneinfo **Describe the bug** I'm trying to use `vermin` on a project that uses `zoneinfo`. The project is properly set up to install the backport on Python < 3.9. However, vermin reports this as a violation, and won't take `--backport zoneinfo`. **To Reproduce** ```sh ...
diff --git a/vermin/backports.py b/vermin/backports.py index f10c6f8..2d32b07 100644 --- a/vermin/backports.py +++ b/vermin/backports.py @@ -27,6 +27,8 @@ BACKPORTS = ( ("typing_extensions==4.0", ["https://pypi.org/project/typing-extensions/4.0.0/"], (None, (3, 6))), ("typing_extensions==4.3", ["https://pypi.org/...
netromdk__vermin-237
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "vermin/config.py:Config.override_from" ], "edited_modules": [ "vermin/config.py:Config" ] }, "file": "vermin/config.py" } ]
netromdk/vermin
7441f2e0a8edf2d254de7a2fa3e68f3a7da8e107
AttributeError: 'str' object has no attribute 'search' **Describe the bug** If you define `exclusion_regex` in `setup.cfg`, the string is treated as a regex pattern object leading to: ``` Traceback (most recent call last): File "/opt/homebrew/Cellar/python@3.11/3.11.6/Frameworks/Python.framework/Versions/3.11/lib...
diff --git a/vermin/config.py b/vermin/config.py index 2a63f27..d5da9df 100644 --- a/vermin/config.py +++ b/vermin/config.py @@ -47,7 +47,7 @@ class Config: self.__show_tips = other_config.show_tips() self.__analyze_hidden = other_config.analyze_hidden() self.__exclusions = set(other_config.exclusions())...
netromdk__vermin-8
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": null, "edited_modules": null }, "file": "vermin/rules.py" } ]
netromdk/vermin
653670b33ca9a54c95bd1ae06c56ce7474197a82
pathlib module missing in checks **Describe the bug** The pathlib module is available since python 3.4 and is not in the checks **To Reproduce** Code using the pathlib module not having a minimum version of 3.4 **Expected behavior** The minimum version should then be python 3.4 and no python 2 support **Env...
diff --git a/.travis.yml b/.travis.yml index ef67b64..2726025 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,8 +16,8 @@ python: install: - pip install -U pip virtualenv script: -- if [[ $TRAVIS_PYTHON_VERSION != 3.2 ]]; then make setup-venv setup-coverage test-coverage; else make test; fi -- if [[ $TRAVIS_PYTHON_...
networkx__networkx-1328
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": null, "edited_modules": null }, "file": "networkx/__init__.py" }, { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "networkx/classe...
networkx/networkx
c00cf03675a605dd687ef28f7ae312b90f83aedd
(Di)Graph.add_nodes_from broken under IronPython It seems that #1314 breaks (Di)Graph.add_nodes_from in IronPython on Travis pretty badly (see https://travis-ci.org/networkx/networkx/jobs/46474504#L3452 for example). I think that I fixed those functions before. IIRC, that was due to `<dict> in <dict>` returning `false`...
diff --git a/doc/source/developer/gitwash/forking_hell.rst b/doc/source/developer/gitwash/forking_hell.rst index 1e29fc800..26b802ca0 100644 --- a/doc/source/developer/gitwash/forking_hell.rst +++ b/doc/source/developer/gitwash/forking_hell.rst @@ -5,7 +5,7 @@ Making your own copy (fork) of networkx ==================...
networkx__networkx-1407
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "networkx/algorithms/connectivity/connectivity.py:all_pairs_node_connectivity" ], "edited_modules": [ "networkx/algorithms/connectivity/connectivity.py:all_pairs_node_connectivity" ...
networkx/networkx
33c39a05c03d699d76c4e4194ffeb9d818ee3934
bug in all_pairs_node_connectivity For building the dictionary to store the results I was using: ```python all_pairs = dict.fromkeys(nbunch, dict()) ``` Which is using refrences to the same dict for each node. The tests did not catch this (ouch!), I found out while working on #1405. I'll send a PR fixing it, by usi...
diff --git a/networkx/algorithms/connectivity/connectivity.py b/networkx/algorithms/connectivity/connectivity.py index ef31f33a9..bf7916160 100644 --- a/networkx/algorithms/connectivity/connectivity.py +++ b/networkx/algorithms/connectivity/connectivity.py @@ -454,12 +454,13 @@ def all_pairs_node_connectivity(G, nbunch...
networkx__networkx-1781
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "networkx/readwrite/gml.py:parse_gml_lines" ], "edited_modules": [ "networkx/readwrite/gml.py:parse_gml_lines" ] }, "file": "networkx/readwrite/gml.py" } ]
networkx/networkx
328d899fb17bac857eedd9ec3e03f4ede9b11c63
Cannot parse GML files from Cytoscape, possible regression? This does not appear to be a duplicate of #321 -- I cannot parse .GML files produced from Cytoscape, including the "simple.gml" [file](https://networkx.lanl.gov/trac/attachment/ticket/324/simple.gml) as reported in #321. Below is the output I receive if parsin...
diff --git a/networkx/readwrite/gml.py b/networkx/readwrite/gml.py index d9e49d336..d3c8b8527 100644 --- a/networkx/readwrite/gml.py +++ b/networkx/readwrite/gml.py @@ -286,7 +286,7 @@ def parse_gml_lines(lines, label, destringizer): """ def tokenize(): patterns = [ - r'[A-Za-z][0-9A-Za-z]...
networkx__networkx-1908
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "networkx/algorithms/matching.py:maximal_matching" ], "edited_modules": [ "networkx/algorithms/matching.py:maximal_matching" ] }, "file": "networkx/algorithms/matching.p...
networkx/networkx
e0479d2e090ec301de9612330585e9bc8d1f967c
maximal_matching and self loops `maximal_matching` does allow self-loops ```py >>> G = nx.Graph([[1,1]]) >>> nx.matching.maximal_matching(G) {(1, 1)} ``` whereas `max_weight_matching` does not ```py >>> nx.matching.max_weight_matching(G) {} ``` Is this expected behaviour? If not, a simple `u != v` check shou...
diff --git a/networkx/algorithms/matching.py b/networkx/algorithms/matching.py index afc505e5f..6bb064dee 100644 --- a/networkx/algorithms/matching.py +++ b/networkx/algorithms/matching.py @@ -46,7 +46,7 @@ def maximal_matching(G): for u,v in G.edges(): # If the edge isn't covered, add it to the matching ...
networkx__networkx-1963
[ { "changes": { "added_entities": [ "networkx/algorithms/core.py:_core_subgraph" ], "added_modules": [ "networkx/algorithms/core.py:_core_subgraph" ], "edited_entities": [ "networkx/algorithms/core.py:core_number", "networkx/algorithms/core.py:_core_h...
networkx/networkx
ec6dfae2aaebbbbf0a4620002ab795efa6430c25
k-core algorithm produces incorrect output for DiGraph As per title, calling `nx.k_core(G, k = x)` does not return the x-core of a graph, if `G` is a `DiGraph`. See attached file. [6954_2011.txt](https://github.com/networkx/networkx/files/105086/6954_2011.txt) To reproduce, run: ```python import netw...
diff --git a/networkx/algorithms/core.py b/networkx/algorithms/core.py index 2091bb97f..c98c7d77c 100644 --- a/networkx/algorithms/core.py +++ b/networkx/algorithms/core.py @@ -4,30 +4,41 @@ # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. +# +# Authors: Dan Schult (dschult@colgate.edu)...
networkx__networkx-1976
[ { "changes": { "added_entities": null, "added_modules": null, "edited_entities": [ "networkx/algorithms/connectivity/kcutsets.py:all_node_cuts" ], "edited_modules": [ "networkx/algorithms/connectivity/kcutsets.py:all_node_cuts" ] }, "file": "networkx/a...
networkx/networkx
293632863d5e895691b56dff4b12c937b2ea77dc
all_node_cuts returns too few and incorrect cuts. This could be a documentation issue, a bug or a user understanding issue. Are these cases pathological for the algorithm? Given a square graph: a -- b | | c -- d Based on a cursory reading of the documentation, I would have expected all_node...
diff --git a/networkx/algorithms/connectivity/kcutsets.py b/networkx/algorithms/connectivity/kcutsets.py index 2ad8bdfb4..c3457139a 100644 --- a/networkx/algorithms/connectivity/kcutsets.py +++ b/networkx/algorithms/connectivity/kcutsets.py @@ -3,6 +3,7 @@ Kanevsky all minimum node k cutsets algorithm. """ from oper...