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 |
|---|---|---|---|---|---|
mwouts__jupytext-621 | [
{
"changes": {
"added_entities": [
"jupytext/config.py:validate_jupytext_configuration_file"
],
"added_modules": [
"jupytext/config.py:validate_jupytext_configuration_file"
],
"edited_entities": [
"jupytext/config.py:load_jupytext_configuration_file",
... | mwouts/jupytext | 56bbb2021c784f4f765e79685ab0ac1f1c287f4b | Jupytext manager seems to fail with jupyterfs
The content manager for jupytext seems to want a call _get_os_path which seems to break with jupyter-fs metamanager
see jpmorganchase/jupyter-fs#53
| diff --git a/.github/workflows/continuous-integration-pip.yml b/.github/workflows/continuous-integration-pip.yml
index b7f2d02..3437ae2 100644
--- a/.github/workflows/continuous-integration-pip.yml
+++ b/.github/workflows/continuous-integration-pip.yml
@@ -25,6 +25,7 @@ jobs:
pip install autopep8 || true
... |
mwouts__jupytext-634 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"jupytext/contentsmanager.py:_jupytext_writes",
"jupytext/contentsmanager.py:_jupytext_reads",
"jupytext/contentsmanager.py:JupytextContentsManager.__init__",
"jupytext/contentsma... | mwouts/jupytext | aea84d9850fe24a71fe871064ffb0646f5a44eb4 | Jupytext manager seems to fail with jupyterfs
The content manager for jupytext seems to want a call _get_os_path which seems to break with jupyter-fs metamanager
see jpmorganchase/jupyter-fs#53
| diff --git a/.gitignore b/.gitignore
index 1ba731b..17921bf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,3 @@
-.idea
-.vscode
.build
.cache
.coverage
@@ -18,3 +16,13 @@ docs/_build
# Will be created by postBuild
demo/get_started.ipynb
+
+# jetbrains ide stuff
+*.iml
+.idea/
+
+# vscode ide stuff
+*.code-w... |
mwouts__jupytext-717 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": null
},
"file": "jupytext/magics.py"
}
] | mwouts/jupytext | 12fb00e4e00460f889478b0c54dedd157f567174 | %magic can be after indent or tab
I have a code that I expect to work both in colab and jupyter, also in .py
```python
FROM_GOOGLE_COLAB = True
PROJECT_FOLDER = '/content/drive/MyDrive/SOME_REPO_NAME'
if FROM_GOOGLE_COLAB:
!pip install somepackages
from google.colab import drive
drive.mount('/c... | diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index abe4b7a..b86ff3d 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -7,6 +7,9 @@ Jupytext ChangeLog
**Changed**
- Jupytext does not work properly with the new cell ids of the version 4.5 of `nbformat>=5.1.0` yet, so we added the requirement `nbformat<=5.... |
mwouts__world_bank_data-10 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": null
},
"file": "world_bank_data/options.py"
},
{
"changes": {
"added_entities": [
"world_bank_data/request.py:_robust_key"
],
"added_modules... | mwouts/world_bank_data | b975ee524acf1e6c01da835490a8b295e1baa2c9 | Document how to use an http proxy
Cf. http://docs.python-requests.org/en/master/user/advanced/#proxies | diff --git a/README.md b/README.md
index 631ddcc..933ff9c 100644
--- a/README.md
+++ b/README.md
@@ -146,6 +146,14 @@ wb.options.language = 'en'
All requests, except `get_series`, are cached using a _least recently used_ cache from the `cachetools` package.
+## Using behind a proxy
+
+Using the package behind an h... |
mwouts__world_trade_data-4 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": null
},
"file": "setup.py"
},
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"world_trade_data/data.py:ge... | mwouts/world_trade_data | efde8000e428310eeada81131c3c4d006ace305f | IndexError with wits.get_tariff_reported
Hello,
I'm getting an IndexError with the following line(s) of code:
`wits.get_tariff_reported(reporter='840',partner='124',product='all',year='2012')` OR
`wits.get_tariff_reported(reporter='840',partner='124',product='all',year='2012', name_or_id = 'id')`
The output sa... | diff --git a/.travis.yml b/.travis.yml
index 3ac5038..5fc3b45 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,12 +1,11 @@
-dist: xenial # required for Python >= 3.7
+dist: focal # required for Python >= 3.10
language: python
python:
- "3.6"
- "3.7"
- - "2.7"
- - "3.4"
- - "3.5"
- - "3.8-dev"
+ - "3.8"... |
mystor__git-revise-103 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"gitrevise/merge.py:rebase"
],
"edited_modules": [
"gitrevise/merge.py:rebase"
]
},
"file": "gitrevise/merge.py"
},
{
"changes": {
"added_entities": [
... | mystor/git-revise | 4f9e123d852632c18fff58220492728c65418877 | Add `--root` option
When using `git rebase`, one can add the `--root` options to allow editing even the very first commit in a repository.
I would like to have a way to do the same with `git revise`, I even tried using the semi-famous empty tree hash-id, without success. | diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4dd787f..3698e9c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,7 @@
* Fix autosquash order of multiple fixup commits with the same target (#72)
* Use `GIT_SEQUENCE_EDITOR` instead of `SEQUENCE_EDITOR` (#71)
* Fix handling of multiline commit subjects (#86)
+* ... |
mystor__git-revise-53 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"gitrevise/merge.py:rebase",
"gitrevise/merge.py:merge_blobs"
],
"edited_modules": [
"gitrevise/merge.py:rebase",
"gitrevise/merge.py:merge_blobs"
]
},
"... | mystor/git-revise | 162ac90cba010a0f90f2290bf267d130466417d6 | Feature request: Say which patch failed when editing a conflict
A useful feature of `git rebase -i` is that it says which commit failed to apply when there is a conflict:
Could not apply badbeef... Commit bla bla
To me, this is essential information, because the editing is after all not of the end result, but... | diff --git a/gitrevise/merge.py b/gitrevise/merge.py
index 56caeb4..c0171d0 100644
--- a/gitrevise/merge.py
+++ b/gitrevise/merge.py
@@ -31,7 +31,7 @@ def rebase(commit: Commit, parent: Commit) -> Commit:
tree = merge_trees(
Path("/"),
- ("new parent", "old parent", "incoming"),
+ (parent.... |
mystor__git-revise-64 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"gitrevise/todo.py:autosquash_todos"
],
"edited_modules": [
"gitrevise/todo.py:autosquash_todos"
]
},
"file": "gitrevise/todo.py"
}
] | mystor/git-revise | 114a08196382fa37386da52bf58678819bdb9544 | Fixup of fixup not detected correctly
Hi,
I often tend to do a lot of patches and then "squash" them at once. This also often means doing fixup commits to fixup commits. This seems to be completely fine with git rebase as it orders the commits correctly when using `--autosquash`. Revise on the other hand only moves t... | diff --git a/CHANGELOG.md b/CHANGELOG.md
index 466f4d6..ccdf42e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,7 @@
## vNEXT
+* Fixed handling of fixup-of-fixup commits (#58)
* Added support for `git add`'s `--patch` flag (#61)
* Manpage is now installed in `share/man/man1` instead of `man/man1` (#62)
... |
myusuf3__delorean-103 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"delorean/interface.py:parse"
],
"edited_modules": [
"delorean/interface.py:parse"
]
},
"file": "delorean/interface.py"
},
{
"changes": {
"added_entities":... | myusuf3/delorean | bb4611a2c3bd502ea4ec1f1e2b697e21fbab6dc9 | parse function does not parse date string correctly
The dayfirst parameter is default to True, however, it does not make any sense when parse a full formatted date time string as below:
```
from delorean import parse
parse('2017-05-02T05:38:49.899Z').datetime
datetime.datetime(2017, 2, 5, 5, 38, 49, 899000, tzinf... | diff --git a/.travis.yml b/.travis.yml
index 7070c17..ed1aec6 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,6 +1,5 @@
language: python
python:
- - "2.6"
- "2.7"
- "3.3"
- "3.4"
diff --git a/delorean/interface.py b/delorean/interface.py
index 6821645..bd6fb83 100644
--- a/delorean/interface.py
+++ b/delor... |
nackjicholson__aiosql-25 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"aiosql/query_loader.py:QueryLoader._make_query_datum"
],
"edited_modules": [
"aiosql/query_loader.py:QueryLoader"
]
},
"file": "aiosql/query_loader.py"
}
] | nackjicholson/aiosql | b9b5c03999106f5bdd6543f8c3e0a820dc338eeb | Trailing lines in SQL causes a parse exception.
```python
Python 3.8.5 (default, Jul 27 2020, 08:42:51)
[GCC 10.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import aiosql
>>> import psycopg2
>>> from psycopg2.extras import execute_values
>>> sql_str = """
... -- name:... | diff --git a/aiosql/query_loader.py b/aiosql/query_loader.py
index 7a9efb6..d8ec807 100644
--- a/aiosql/query_loader.py
+++ b/aiosql/query_loader.py
@@ -18,7 +18,7 @@ class QueryLoader:
self.record_classes = record_classes if record_classes is not None else {}
def _make_query_datum(self, query_str: str)... |
naftulikay__mutagen-tools-23 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"src/mutagentools/flac/convert.py:convert_flac_to_id3"
],
"edited_modules": [
"src/mutagentools/flac/convert.py:convert_flac_to_id3"
]
},
"file": "src/mutagentools/flac/... | naftulikay/mutagen-tools | 84a04ac4a422feefdb4e9e4dba82fbb7586b1148 | Disc Count isn't Being Copied Properly from EasyTAG FLACs to MP3s
**TL;DR** EasyTAG removes the `encoder` tag :unamused: and screws things up with the tags it uses.
Three bugs have been identified in `flac2id3`. two of which are fixable in this project:
- Prevent EasyTag from removing the `encoder` tag.
- [ ] ... | diff --git a/src/mutagentools/flac/convert.py b/src/mutagentools/flac/convert.py
index 0ce867e..8b0438a 100644
--- a/src/mutagentools/flac/convert.py
+++ b/src/mutagentools/flac/convert.py
@@ -46,8 +46,8 @@ def convert_flac_to_id3(flac):
result.append(convert_genre_to_tcon(tags.pop('genre'), tags.pop('style') ... |
nagisc007__storybuilder-181 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"builder/tools.py:_story_title_of"
],
"edited_modules": [
"builder/tools.py:_story_title_of"
]
},
"file": "builder/tools.py"
}
] | nagisc007/storybuilder | 0beb7a2554cb09dcdc523aa63dbb6ffb4f58a007 | Need to fix: append head break line at scene head
シーン冒頭、前に一行開ける
===
**Description**
action出力にて、シーン冒頭のマークダウン、もう一行前も開けておく
| diff --git a/builder/tools.py b/builder/tools.py
index d67e47e..119a5d3 100644
--- a/builder/tools.py
+++ b/builder/tools.py
@@ -298,5 +298,5 @@ def _story_title_of(act: TagAction, level: int) -> str:
assert isinstance(act, TagAction), "act Must be TagAction class!"
assert isinstance(level, int), "level Must ... |
nagisc007__storybuilder-196 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"builder/commons.py:extraspace_chopped"
],
"edited_modules": [
"builder/commons.py:extraspace_chopped"
]
},
"file": "builder/commons.py"
}
] | nagisc007/storybuilder | 2b764e3c3e949af354d6d32467e9f2780386e301 | Need to fix: unreplaced maru and ten
「。、」が放置されてしまっているので修正
===
**Description**
Description中の「。」で終わるものが「。、」になるが、それが放置されたままなので修正
| diff --git a/builder/commons.py b/builder/commons.py
index 720a692..de6ab2d 100644
--- a/builder/commons.py
+++ b/builder/commons.py
@@ -74,7 +74,7 @@ def extraspace_chopped(target: str, lang: LangType) -> str:
assert_isclass(lang, LangType)
if lang is LangType.JPN:
- return re.sub(r'。 (.)', r'。\1', ... |
nagisc007__storybuilder-199 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"builder/tools.py:_story_converted_as_description_in_group"
],
"edited_modules": [
"builder/tools.py:_story_converted_as_description_in_group"
]
},
"file": "builder/tool... | nagisc007/storybuilder | b7872d78caf82d0de954c029bad6838afd1a25d1 | Need to fix: combine bug
combine bug display one line
===
**Description**
Combineすると全て1文字ずつで改行されて、縦に一行表示みたいになる
| diff --git a/builder/tools.py b/builder/tools.py
index 82180f7..cf97ad0 100644
--- a/builder/tools.py
+++ b/builder/tools.py
@@ -367,7 +367,7 @@ def _story_converted_as_description_in_group(group: ActionGroup, group_type: Gro
if val:
tmp.append(val)
if group_type is GroupType.COMBI:
-... |
nagisc007__storybuilder-212 | [
{
"changes": {
"added_entities": [
"builder/commons.py:double_comma_chopped"
],
"added_modules": [
"builder/commons.py:double_comma_chopped"
],
"edited_entities": [
"builder/commons.py:extraspace_chopped"
],
"edited_modules": [
"builder/c... | nagisc007/storybuilder | 7f364a8a36eee01df5d51157cd4b5c5eefaf34e5 | Need to fix: kakko space bug
”」 ”になる
===
**Description**
かぎかっこの後については考慮されていなかったようで、combineしてしまうとそこが空白が空いてしまう。
| diff --git a/builder/commons.py b/builder/commons.py
index e3b2870..39450a5 100644
--- a/builder/commons.py
+++ b/builder/commons.py
@@ -69,6 +69,16 @@ def dialogue_from_info(act: Action, lang: LangType) -> str:
return "「{}」".format(infos_of(act).replace('/', '、')) if lang == LangType.JPN else ' "{}" '.format(info... |
nagisc007__storybuilder-224 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"builder/master.py:Master.set_db",
"builder/master.py:Master.set_days",
"builder/master.py:Master.set_items",
"builder/master.py:Master.set_persons",
"builder/master.py:Ma... | nagisc007/storybuilder | b0219f7a7883f24de99ee8269d1e60b83130deed | Need to fix: nothing error in storyDB
空の要素で失敗
===
**Description**
StoryDBの引数で要素が空のタプルが含まれている時にerror発生。審査して作らないように対処。
| diff --git a/builder/master.py b/builder/master.py
index 3a72f96..00a1f2a 100644
--- a/builder/master.py
+++ b/builder/master.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""Story manager class.
"""
-from .sbutils import assert_isint, assert_isstr
+from .sbutils import assert_isint, assert_islist, assert_isstr
from .... |
nagisc007__storybuilder-231 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"builder/tools.py:output_story",
"builder/tools.py:_story_info_data_converted"
],
"edited_modules": [
"builder/tools.py:output_story",
"builder/tools.py:_story_info_da... | nagisc007/storybuilder | 2a384c6fc03336ac50edb24e2281ed3b8529bab6 | Implement: info output
No output currently
===
**Description**
現在infoは出力内容がないので、そこを修正
| diff --git a/builder/tools.py b/builder/tools.py
index 07349c4..f196f9a 100644
--- a/builder/tools.py
+++ b/builder/tools.py
@@ -66,7 +66,7 @@ def output_story(story: ActionGroup, filename: str, is_action_data: bool=False,
is_info_data: bool=False,
is_out_as_file: bool=False, is_out_chars: bool=False,... |
nagisc007__storybuilder-354 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"builder/buildtool.py:_manupaper_rows_from_",
"builder/buildtool.py:_manupaper_rows_from_in"
],
"edited_modules": [
"builder/buildtool.py:_manupaper_rows_from_",
"buil... | nagisc007/storybuilder | d711a90a6034bb61c176ccc809b367450c469fee | Check: character count when combined
combine した時にちゃんと行と文字数がカウントできているか
===
**Description**
combine時の確認。
間違っていたら修正。
| diff --git a/builder/buildtool.py b/builder/buildtool.py
index 5c005fe..08449e3 100644
--- a/builder/buildtool.py
+++ b/builder/buildtool.py
@@ -271,7 +271,7 @@ def _manupaper_rows_from_(val, lang: em.LangType, columns: int) -> int:
elif isinstance(val, act.TagAction):
return 0
elif isinstance(val, a... |
nagisc007__storybuilder-54 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"builder/person.py:Person.agree",
"builder/person.py:Person.ask",
"builder/person.py:Person.brow",
"builder/person.py:Person.call",
"builder/person.py:Person.check",
... | nagisc007/storybuilder | aaaca7a475d697fa159dffff4bbe629a686577bb | Need to fix: forget "self" keyword in person's attr
Person内のsub actにおいてselfが抜けていたので修正。
===
**Description**
sub_actでは既に設定した、例えば see などを呼び出して使っているが、それに対してselfがないのでundefinedになる。
**To Reproduce**
nothing
**Expected behavior**
nothing
**Current behavior**
nothing
**Tasks**
- [ ] fix all sub acts in Pers... | diff --git a/builder/person.py b/builder/person.py
index aae74b0..9a6c312 100644
--- a/builder/person.py
+++ b/builder/person.py
@@ -85,47 +85,47 @@ class Person(BasePerson):
# sub actions
def agree(self, action, act_word="頷く", with_act=True, with_sub=False):
- return reply(action, act_word, with_act... |
nagisc007__storybuilder-79 | [
{
"changes": {
"added_entities": [
"builder/tools.py:_period_by_lang",
"builder/tools.py:_comma_by_lang",
"builder/tools.py:_paragraphtop_by_lang",
"builder/tools.py:_double_quatation_by_lang"
],
"added_modules": [
"builder/tools.py:_period_by_lang",
... | nagisc007/storybuilder | 6f5020584b00ffd715c5a4728bf3488c7daec9c6 | Need to fix: action output with japanese spaces
日本語の時にはスペースを「全角」で適用する
===
**Description**
actionでのoutput時に半角だと折角そろえたものがずれているので、そこを読み取って調整する。
| diff --git a/builder/tools.py b/builder/tools.py
index c36e60b..1c8ebbe 100644
--- a/builder/tools.py
+++ b/builder/tools.py
@@ -99,21 +99,33 @@ def _story_converted_as_action_in_group(group: ActionGroup, level: int, is_debug
if isinstance(a, ActionGroup):
tmp.extend(_story_converted_as_action_in_... |
nalepae__pandarallel-188 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"pandarallel/core.py:parallelize_with_memory_file_system",
"pandarallel/core.py:parallelize_with_pipe"
],
"edited_modules": [
"pandarallel/core.py:parallelize_with_memory_file... | nalepae/pandarallel | bb0f50faf9bd3e8e548736040d297613d4482eaa | parallel_apply(..., axis=0) return duplicated rows.
this behavior is different from pandas. | diff --git a/pandarallel/core.py b/pandarallel/core.py
index f96359c..8eaaf12 100644
--- a/pandarallel/core.py
+++ b/pandarallel/core.py
@@ -235,7 +235,7 @@ def parallelize_with_memory_file_system(
progresses_length = [len(chunk_) * multiplicator_factor for chunk_ in chunks]
work_extra = data_type.g... |
nalepae__pandarallel-200 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"pandarallel/core.py:parallelize_with_memory_file_system"
],
"edited_modules": [
"pandarallel/core.py:parallelize_with_memory_file_system"
]
},
"file": "pandarallel/core... | nalepae/pandarallel | a402a038d5e50a1da6b9944228d4195a6e735b89 | Exception in function passed to `parallel_apply` results in obscure `EOFError`
## General
- **Operating System**: Arch Linux (Linux kernel version 5.16.16)
- **Python version**: 3.10.4
- **Pandas version**: 1.4.1
- **Pandarallel version**: 1.6.1
## Acknowledgement
- My issue is **NOT** present when using `p... | diff --git a/README.md b/README.md
index f3ba460..2ccb68f 100644
--- a/README.md
+++ b/README.md
@@ -18,7 +18,7 @@ CPUs by changing only one line of code. It also displays progress bars.
## Installation
```bash
-pip install pandarallel [--upgrade] [--user]
+pip install pandarallel [--upgrade] [--user]`
```
## Q... |
nalepae__pandarallel-235 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": [
"pandarallel/data_types/dataframe_groupby.py:DataFrameGroupBy"
]
},
"file": "pandarallel/data_types/dataframe_groupby.py"
}
] | nalepae/pandarallel | b78c63c99a21e479444b7ccd1939222136c2c7fc | Add pandas@2.0 to test matrix | diff --git a/pandarallel/data_types/dataframe_groupby.py b/pandarallel/data_types/dataframe_groupby.py
index 9f92797..f2dbb91 100644
--- a/pandarallel/data_types/dataframe_groupby.py
+++ b/pandarallel/data_types/dataframe_groupby.py
@@ -77,7 +77,5 @@ class DataFrameGroupBy:
mutated = cast(List[bool], mutat... |
nalepae__pandarallel-245 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"pandarallel/progress_bars.py:ProgressBarsConsole.__update_line",
"pandarallel/progress_bars.py:ProgressBarsNotebookLab.update"
],
"edited_modules": [
"pandarallel/progress_ba... | nalepae/pandarallel | 4666931c6df4c67e0345f42ad45150adba3f3f83 | parallel_apply on empty dataframe fails with confusing error
I occasionally have code that should fail earlier because I've accidentally created an empty dataframe, however I've found that `parallel_apply` fails when `apply` does not on these, with an error from `multiprocessing`. I'm not sure if the desired behavior f... | diff --git a/pandarallel/progress_bars.py b/pandarallel/progress_bars.py
index ffaa738..ec6602c 100644
--- a/pandarallel/progress_bars.py
+++ b/pandarallel/progress_bars.py
@@ -90,7 +90,10 @@ class ProgressBarsConsole(ProgressBars):
self.__lines = []
def __update_line(self, done: int, total: int) -> str... |
namaggarwal__splitwise-32 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"splitwise/__init__.py:Splitwise.createGroup"
],
"edited_modules": [
"splitwise/__init__.py:Splitwise"
]
},
"file": "splitwise/__init__.py"
},
{
"changes": {
... | namaggarwal/splitwise | 1c1803d42822e581135973943d7acc9e1a837518 | Write Tests
We need to write tests for each of the API. | diff --git a/splitwise/__init__.py b/splitwise/__init__.py
index 88c36ee..776d957 100644
--- a/splitwise/__init__.py
+++ b/splitwise/__init__.py
@@ -311,7 +311,7 @@ class Splitwise(object):
if "group" in content:
group_detail = Group(content["group"])
if "errors" in content["group"]:
... |
namaggarwal__splitwise-61 | [
{
"changes": {
"added_entities": [
"splitwise/__init__.py:Splitwise.updateExpense"
],
"added_modules": null,
"edited_entities": null,
"edited_modules": [
"splitwise/__init__.py:Splitwise"
]
},
"file": "splitwise/__init__.py"
}
] | namaggarwal/splitwise | d4aee5b82cda725277b985885a78b9696697bb7a | add update expense function
Implement the updateExpense API | diff --git a/README.md b/README.md
index 450de56..41a155f 100644
--- a/README.md
+++ b/README.md
@@ -320,6 +320,32 @@ success, errors = sObj.deleteGroup(4456)
print(success)
```
+
+### Update Expense
+
+You can use ```updateExpense(Expense)``` to update an existing Expense. It takes in parameter a partial ```Expens... |
nanonyme__simplecpreprocessor-11 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"simplecpreprocessor.py:Preprocessor.process_source_line",
"simplecpreprocessor.py:Preprocessor._recursive_transform"
],
"edited_modules": [
"simplecpreprocessor.py:Preprocess... | nanonyme/simplecpreprocessor | 766d87b952e0ad6f573ce396aff41cc13521e79e | Macro expansion produces produces wrong results
See for details https://github.com/nanonyme/simplecpreprocessor/commit/c3a1d4617fa0977bbc0f6bd0098b2d74219489bf | diff --git a/simplecpreprocessor.py b/simplecpreprocessor.py
index d6d025b..53da5fb 100644
--- a/simplecpreprocessor.py
+++ b/simplecpreprocessor.py
@@ -104,6 +104,7 @@ IFDEF = "ifdef"
IFNDEF = "ifndef"
ELSE = "else"
SKIP_FILE = object()
+TOKEN = re.compile(r"\b\w+\b")
class Preprocessor(object):
@@ -228,27 +22... |
nanonyme__simplecpreprocessor-19 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": null
},
"file": "simplecpreprocessor/__init__.py"
},
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"ed... | nanonyme/simplecpreprocessor | 27448eeaa8331ad6185a24116cdaa0458c9edb78 | Tokens should not be expanded inside strings
Current token expansion logic needs a rewrite. Quoted strings are considered single tokens. This is most likely not possible to implement by retaining the concept of yielding entire lines out of expander
- [x] Write failing tests
- [x] Fix tests | diff --git a/simplecpreprocessor/__init__.py b/simplecpreprocessor/__init__.py
index 603177f..66e416e 100644
--- a/simplecpreprocessor/__init__.py
+++ b/simplecpreprocessor/__init__.py
@@ -4,6 +4,6 @@ try:
__version__ = get_distribution(__name__).version
except DistributionNotFound:
from setuptools_scm impor... |
napalm-automation-community__napalm-ros-86 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"napalm_ros/ros.py:ROSDriver.get_interfaces_counters"
],
"edited_modules": [
"napalm_ros/ros.py:ROSDriver"
]
},
"file": "napalm_ros/ros.py"
}
] | napalm-automation-community/napalm-ros | 0e5d11b2890559ae4321c21278746a6424f2dc65 | Method get_interfaces_counters failed: 'tx-error'
### Description of Issue/Question
get_interfaces_counters doesn't work. It reproduces error:
```
GET /api/dcim/devices/2/napalm/?method=get_interfaces_counters
HTTP 200 OK
Allow: GET, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept
{
"get_int... | diff --git a/napalm_ros/ros.py b/napalm_ros/ros.py
index 84a566f..2fe20d7 100644
--- a/napalm_ros/ros.py
+++ b/napalm_ros/ros.py
@@ -58,10 +58,10 @@ class ROSDriver(NetworkDriver):
for iface in self.api('/interface/print', stats=True):
result[iface['name']] = defaultdict(int)
stats = ... |
napalm-automation-community__napalm-s350-39 | [
{
"changes": {
"added_entities": [
"napalm_s350/s350.py:S350Driver._get_lldp_neighbors_line_to_fields",
"napalm_s350/s350.py:S350Driver._get_lldp_neighbors_fields_end"
],
"added_modules": null,
"edited_entities": [
"napalm_s350/s350.py:S350Driver.get_lldp_neighbor... | napalm-automation-community/napalm-s350 | efc48421d4d975d790feaaa73a6151372ce5b10a | parsing show lldp neighbors
I am working my way through the development branch and came across the parser for lldp neigbors. I don't think it works reliably. I have seen the case that both the system name and the port ID can be wrapped.
Examples:
```
switchf5bcdb#show lldp neighbors
System capability legend:
... | diff --git a/napalm_s350/s350.py b/napalm_s350/s350.py
index 23c371a..206249f 100644
--- a/napalm_s350/s350.py
+++ b/napalm_s350/s350.py
@@ -406,14 +406,17 @@ class S350Driver(NetworkDriver):
match = re.match(r'^--------- -+ .*$', line)
if match:
header = False
+ ... |
napalm-automation-community__napalm-s350-44 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"napalm_s350/s350.py:S350Driver.get_facts",
"napalm_s350/s350.py:S350Driver._get_facts_parse_inventory",
"napalm_s350/s350.py:S350Driver.get_interfaces_ip",
"napalm_s350/s350.py:S... | napalm-automation-community/napalm-s350 | 550b0dd0265326fd3a6f46ed27dafe144f147f2a | Unit tests for SG500
Todo:
- [x] command output
- [x] get_arp_table
- [x] get_arp_table_with_vrf
- [x] get_config
- [x] get_config_filtered
- [x] get_config_sanitized
- [x] get_facts
- [x] get_interfaces
- [x] get_interfaces_ip
- [x] get_lldp_neighbors
- [x] get_lldp_neighbors_detail
- [x] get_ntp_servers
... | diff --git a/napalm_s350/s350.py b/napalm_s350/s350.py
index 97df73f..23c371a 100644
--- a/napalm_s350/s350.py
+++ b/napalm_s350/s350.py
@@ -239,14 +239,19 @@ class S350Driver(NetworkDriver):
_, hostname = line.split('System Name:')
hostname = hostname.strip()
continue... |
napjon__krisk-21 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"krisk/make_chart.py:make_chart"
],
"edited_modules": [
"krisk/make_chart.py:make_chart"
]
},
"file": "krisk/make_chart.py"
},
{
"changes": {
"added_entiti... | napjon/krisk | 22d261e50cfac645255a4b6569633633a0b6d52e | if category, bar plot not shown all index values
See http://nbviewer.jupyter.org/github/napjon/krisk/blob/master/notebooks/themes-colors.ipynb
Not all year index values shown | diff --git a/README.md b/README.md
index 0ac2848..2392b25 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,5 @@
[](https://circleci.com/gh/napjon/krisk)
[](https://pypi.python.org/pypi/krisk/)
-[![Co... |
napjon__krisk-37 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"krisk/chart.py:Chart.set_tooltip_format",
"krisk/chart.py:Chart._get_duplicated"
],
"edited_modules": [
"krisk/chart.py:Chart"
]
},
"file": "krisk/chart.py"
}... | napjon/krisk | 7aeaac1b566ffe71d7282c41eb09567845eecf01 | Consistent API parameters with Pandas and Matplotlib (BREAKING API)
This will break API change.
* Convert size to s
* Convert category to c | diff --git a/krisk/chart.py b/krisk/chart.py
index 9517dff..44a75c6 100644
--- a/krisk/chart.py
+++ b/krisk/chart.py
@@ -152,11 +152,11 @@ class Chart(object):
raise TypeError('Chart Type not supported')
else:
f_columns = []
- for c in columns:
- if isinstanc... |
napjon__krisk-38 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"krisk/plot/__init__.py:bar",
"krisk/plot/__init__.py:line"
],
"edited_modules": [
"krisk/plot/__init__.py:bar",
"krisk/plot/__init__.py:line"
]
},
"file... | napjon/krisk | c92fc16f5d02d14478e578cc778639c39eff2de2 | Add full area (100%) for stacked bar and line chart | diff --git a/krisk/plot/__init__.py b/krisk/plot/__init__.py
index 0ed9354..14e24b8 100644
--- a/krisk/plot/__init__.py
+++ b/krisk/plot/__init__.py
@@ -7,7 +7,8 @@ def bar(df,
c=None,
how='count',
stacked=False,
- annotate=None):
+ annotate=None,
+ full=False):
"""
... |
napjon__krisk-39 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"krisk/plot/__init__.py:bar"
],
"edited_modules": [
"krisk/plot/__init__.py:bar"
]
},
"file": "krisk/plot/__init__.py"
},
{
"changes": {
"added_entities": ... | napjon/krisk | b7489f45df16b6805b2f576d696dabc1a3bc5235 | Add trendline parameters for bar chart
Add trendline that shows changes for bar chart | diff --git a/krisk/plot/__init__.py b/krisk/plot/__init__.py
index 14e24b8..e702c4a 100644
--- a/krisk/plot/__init__.py
+++ b/krisk/plot/__init__.py
@@ -8,7 +8,8 @@ def bar(df,
how='count',
stacked=False,
annotate=None,
- full=False):
+ full=False,
+ trendline=False):
... |
napjon__krisk-41 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"krisk/plot/__init__.py:line",
"krisk/plot/__init__.py:hist"
],
"edited_modules": [
"krisk/plot/__init__.py:line",
"krisk/plot/__init__.py:hist"
]
},
"fi... | napjon/krisk | 6944f1150e675a1e4ef824bc3ed6c0c41526e54a | Add smooth line for histogram and all type of line chart as well
Echarts Density Line for Histogram: http://echarts.baidu.com/demo.html#mix-line-bar
* Add an option to disable bar, line, or using both for histogram.
* For all type of line chart, added smooth boolean as additional argument, add to every line series. | diff --git a/krisk/plot/__init__.py b/krisk/plot/__init__.py
index e702c4a..842f2bd 100644
--- a/krisk/plot/__init__.py
+++ b/krisk/plot/__init__.py
@@ -55,7 +55,8 @@ def line(df,
stacked=False,
area=False,
annotate=None,
- full=False):
+ full=False,
+ smooth=False)... |
napjon__krisk-53 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"krisk/plot/api.py:bar",
"krisk/plot/api.py:line"
],
"edited_modules": [
"krisk/plot/api.py:bar",
"krisk/plot/api.py:line"
]
},
"file": "krisk/plot/api.p... | napjon/krisk | 19fb69026ff1339649fac5ad82548ccbdc7b8d19 | Add Bar Mode for Sequential, Diverging, and Qualitative
add 'mode' as keyword parameter for bar chart.
* If None, treat the bar mode as "Qualitative", and sort on lexicographical order.
* If Boolean, treat the bar as "Sequential", whether the order sort ascending.
* If string, either median or mean and deviation f... | diff --git a/krisk/plot/api.py b/krisk/plot/api.py
index 281688f..dd4437d 100644
--- a/krisk/plot/api.py
+++ b/krisk/plot/api.py
@@ -9,7 +9,10 @@ def bar(df,
stacked=False,
annotate=None,
full=False,
- trendline=False):
+ trendline=False,
+ sort_on='index',
+ sort_... |
napjon__krisk-58 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"krisk/plot/make_chart.py:make_chart"
],
"edited_modules": [
"krisk/plot/make_chart.py:make_chart"
]
},
"file": "krisk/plot/make_chart.py"
}
] | napjon/krisk | 8497da2333a8265b2e19c87dcec3bae20b8d4059 | Line Plot should have default trigger axis and axis pointer shadow | diff --git a/krisk/plot/make_chart.py b/krisk/plot/make_chart.py
index 924e015..68e3c41 100644
--- a/krisk/plot/make_chart.py
+++ b/krisk/plot/make_chart.py
@@ -43,6 +43,9 @@ def make_chart(df, **kwargs):
if kwargs.get('y', None):
chart.set_ylabel(kwargs['y'])
+ if kwargs['type'] == 'line':
+ ... |
napjon__krisk-61 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"krisk/chart/core.py:Chart.set_ylabel"
],
"edited_modules": [
"krisk/chart/core.py:Chart"
]
},
"file": "krisk/chart/core.py"
},
{
"changes": {
"added_entit... | napjon/krisk | cbf39a0b5f2876a7cf1ce45361be3ba79aba4dc7 | Add bar_line chart
Adding chart with bar and line with different series but same x-axis. For example,
``` Python
kk.bar_line(df, x, y_bar, y_line, c=None, .....)
```
| diff --git a/krisk/chart/core.py b/krisk/chart/core.py
index e62d98f..f4ae35a 100644
--- a/krisk/chart/core.py
+++ b/krisk/chart/core.py
@@ -419,6 +419,7 @@ class Chart(object):
def _set_label_axes(self, xy, **kwargs):
"""Set label axes name and other customization"""
assert xy in ['x','y']
+
... |
napjon__krisk-63 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"krisk/util.py:init_notebook"
],
"edited_modules": [
"krisk/util.py:init_notebook"
]
},
"file": "krisk/util.py"
}
] | napjon/krisk | 5d5980a518bb36fd7b1624fc36c2fbaa5c247e9b | Not support nbconvert
**Reproduce:**
1. Use Intro.ipynb
2. Remove `from krisk import init_notebook; init_notebook()` since it's not gonna publish to nbviewer.
3. Use nbconvert to export current page as html
**Output:**
Javascript part failed to print out.
Console error:
`require.min.js:8 Uncaught Error: Scri... | diff --git a/krisk/util.py b/krisk/util.py
index db8bcb3..f798d93 100644
--- a/krisk/util.py
+++ b/krisk/util.py
@@ -25,9 +25,9 @@ def init_notebook():
from IPython.display import Javascript
return Javascript("""
require.config({
- baseUrl : "//cdn.rawgit.com/napjon/krisk/master/krisk/sta... |
narwhals-dev__narwhals-1014 | [
{
"changes": {
"added_entities": [
"narwhals/dataframe.py:DataFrame.to_native"
],
"added_modules": null,
"edited_entities": null,
"edited_modules": [
"narwhals/dataframe.py:DataFrame"
]
},
"file": "narwhals/dataframe.py"
}
] | narwhals-dev/narwhals | cba61e154878e8b523bd02a3ff895a85db494281 | enh: implement `DataFrame.to_native`
Currently, we can call `nw.to_native`
It would be more user-friendly to have `DataFrame.to_native` though, I keep finding myself reaching for this
Contributing guide: https://github.com/narwhals-dev/narwhals/blob/main/CONTRIBUTING.md | diff --git a/docs/api-reference/dataframe.md b/docs/api-reference/dataframe.md
index fe0c4025..f593293f 100644
--- a/docs/api-reference/dataframe.md
+++ b/docs/api-reference/dataframe.md
@@ -37,6 +37,7 @@
- tail
- to_arrow
- to_dict
+ - to_native
- to_numpy
- to_panda... |
narwhals-dev__narwhals-1016 | [
{
"changes": {
"added_entities": [
"narwhals/series.py:Series.to_native"
],
"added_modules": null,
"edited_entities": [
"narwhals/series.py:Series.__repr__"
],
"edited_modules": [
"narwhals/series.py:Series"
]
},
"file": "narwhals/series.... | narwhals-dev/narwhals | 55e71486a31c6b0713f59d6bd22dbefef9afae9c | docs: include PyArrow in Tutorial/DataFrame
In https://narwhals-dev.github.io/narwhals/basics/dataframe/ we only show pandas + Polars. Let's get PyArrow in there too?
I'd suggest:
- for all except for "example 3", we could have tabs for: pandas, Polars[lazy], PyArrow
- for example 3, we could have: pandas, Polars[... | diff --git a/docs/api-reference/series.md b/docs/api-reference/series.md
index c016b566..9868e7b9 100644
--- a/docs/api-reference/series.md
+++ b/docs/api-reference/series.md
@@ -57,6 +57,7 @@
- to_list
- to_numpy
- to_pandas
+ - to_native
- unique
- value_counts
... |
narwhals-dev__narwhals-1020 | [
{
"changes": {
"added_entities": [
"narwhals/series.py:Series.to_native"
],
"added_modules": null,
"edited_entities": [
"narwhals/series.py:Series.__repr__"
],
"edited_modules": [
"narwhals/series.py:Series"
]
},
"file": "narwhals/series.... | narwhals-dev/narwhals | 55e71486a31c6b0713f59d6bd22dbefef9afae9c | Implement Series.to_native
Currently, we can call `nw.to_native`
It would be more user-friendly to have `Series.to_native` though, I keep finding myself reaching for this
Contributing guide: https://github.com/narwhals-dev/narwhals/blob/main/CONTRIBUTING.md | diff --git a/docs/api-reference/series.md b/docs/api-reference/series.md
index c016b566..9868e7b9 100644
--- a/docs/api-reference/series.md
+++ b/docs/api-reference/series.md
@@ -57,6 +57,7 @@
- to_list
- to_numpy
- to_pandas
+ - to_native
- unique
- value_counts
... |
narwhals-dev__narwhals-1026 | [
{
"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 | 58d8535ec9737b5ae0623a1eb5aa22b4eaa2ece0 | [Bug]: Can not subset using `tuple()`
### Describe the bug
[Docs say](https://narwhals-dev.github.io/narwhals/api-reference/dataframe/#narwhals.dataframe.DataFrame.__getitem) you can subset using a `Sequence`. This should support `tuple()`, not just `list()`
### Steps or code to reproduce the bug
```python
im... | diff --git a/narwhals/_arrow/dataframe.py b/narwhals/_arrow/dataframe.py
index 5b74ddb7..89919c76 100644
--- a/narwhals/_arrow/dataframe.py
+++ b/narwhals/_arrow/dataframe.py
@@ -136,6 +136,9 @@ class ArrowDataFrame:
| tuple[slice, str | int]
| tuple[slice, slice],
) -> ArrowSeries | ArrowDataFra... |
narwhals-dev__narwhals-1040 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"narwhals/_arrow/series.py:ArrowSeries.to_dummies"
],
"edited_modules": [
"narwhals/_arrow/series.py:ArrowSeries"
]
},
"file": "narwhals/_arrow/series.py"
},
{
"... | narwhals-dev/narwhals | 9a51501d727c11ce486b9918dc4d6eced80bbddc | [Bug]: Series.to_dummies raises for PyArrow when nulls are present
### Describe the bug
Calling `to_dummies` on a Series with nulls present raises an error
### Steps or code to reproduce the bug
```python
# ruff: noqa
# todo:
# - Series.rename, as alias for Series.alias. it's OK
import pyarrow as pa
import ... | diff --git a/narwhals/_arrow/series.py b/narwhals/_arrow/series.py
index 85ac3ec1..d0c2bf98 100644
--- a/narwhals/_arrow/series.py
+++ b/narwhals/_arrow/series.py
@@ -752,17 +752,32 @@ class ArrowSeries:
from narwhals._arrow.dataframe import ArrowDataFrame
series = self._native_series
- da = ... |
narwhals-dev__narwhals-1044 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": null
},
"file": "narwhals/__init__.py"
},
{
"changes": {
"added_entities": [
"narwhals/_arrow/expr.py:ArrowExpr.from_column_indices"
],
"adde... | narwhals-dev/narwhals | b4aaa4ac87e5df0a3a12afa0eea1ba6f6fe18dfe | [Enh]: adding nth() to dataframe
### 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?
Like [nth() in polars](https://docs.pola.rs/api/python/stable/reference/expressions/api/polars.nth.html), i... | diff --git a/docs/api-reference/narwhals.md b/docs/api-reference/narwhals.md
index 9d7ac384..d678b873 100644
--- a/docs/api-reference/narwhals.md
+++ b/docs/api-reference/narwhals.md
@@ -28,6 +28,7 @@ Here are the top-level functions available in Narwhals.
- min
- narwhalify
- new_series
+ ... |
narwhals-dev__narwhals-1057 | [
{
"changes": {
"added_entities": [
"narwhals/_arrow/series.py:ArrowSeries.__iter__"
],
"added_modules": null,
"edited_entities": null,
"edited_modules": [
"narwhals/_arrow/series.py:ArrowSeries"
]
},
"file": "narwhals/_arrow/series.py"
},
{
"ch... | narwhals-dev/narwhals | 0e26ef657388f827f71511b160d98a8cf1828d6e | [Enh]: Add `__iter__` support to `Series`
### 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?
posit-dev/py-shiny . Not required... just a bonus
### Please describe the purpose of the new feat... | diff --git a/docs/api-reference/series.md b/docs/api-reference/series.md
index 9868e7b9..5adaa57a 100644
--- a/docs/api-reference/series.md
+++ b/docs/api-reference/series.md
@@ -6,6 +6,7 @@
members:
- __arrow_c_stream__
- __getitem__
+ - __iter__
- abs
- alias
... |
narwhals-dev__narwhals-1066 | [
{
"changes": {
"added_entities": [
"narwhals/_duckdb/dataframe.py:DuckDBInterchangeFrame.to_pandas",
"narwhals/_duckdb/dataframe.py:DuckDBInterchangeFrame.to_arrow"
],
"added_modules": null,
"edited_entities": null,
"edited_modules": [
"narwhals/_duckdb/data... | narwhals-dev/narwhals | bbabe445a9f028a032269349b6949232d559b9eb | [Enh]: add `InterchangeFrame.to_pandas` and `InterchangeFrame.to_arrow`
### 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?
Plotly casts to pandas if a dataframe implements the interchange ... | diff --git a/narwhals/_duckdb/dataframe.py b/narwhals/_duckdb/dataframe.py
index 8de24465..2263c3fc 100644
--- a/narwhals/_duckdb/dataframe.py
+++ b/narwhals/_duckdb/dataframe.py
@@ -4,8 +4,13 @@ from typing import TYPE_CHECKING
from typing import Any
from narwhals import dtypes
+from narwhals.utils import parse_ve... |
narwhals-dev__narwhals-1073 | [
{
"changes": {
"added_entities": [
"narwhals/series.py:Series.rename"
],
"added_modules": null,
"edited_entities": null,
"edited_modules": [
"narwhals/series.py:Series"
]
},
"file": "narwhals/series.py"
},
{
"changes": {
"added_entities":... | narwhals-dev/narwhals | e49dba107b9207146af03adb26999a336e00eb86 | feat: series.rename
I keep reaching for this and realising it doesn't exist
reference: https://docs.pola.rs/api/python/stable/reference/series/api/polars.Series.rename.html | diff --git a/docs/api-reference/series.md b/docs/api-reference/series.md
index 5adaa57a..e8572dda 100644
--- a/docs/api-reference/series.md
+++ b/docs/api-reference/series.md
@@ -43,6 +43,7 @@
- null_count
- pipe
- quantile
+ - rename
- round
- sample
- scatt... |
narwhals-dev__narwhals-1075 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"narwhals/_arrow/namespace.py:ArrowNamespace.all_horizontal",
"narwhals/_arrow/namespace.py:ArrowNamespace.any_horizontal",
"narwhals/_arrow/namespace.py:ArrowNamespace.sum_horizontal"
... | narwhals-dev/narwhals | e49dba107b9207146af03adb26999a336e00eb86 | [Bug]: `nw.all()` doesn't work in `sum_horizontal` if native df is `pd.DataFrame`
### Describe the bug
`nw.all()` doesn't work in `sum_horizontal` if native df is `pd.DataFrame`
It works well for `pl.DataFrame` and it works for `pd.DataFrame` with columns names.
### Steps or code to reproduce the bug
```
import pa... | diff --git a/docs/api-reference/series.md b/docs/api-reference/series.md
index 5adaa57a..e8572dda 100644
--- a/docs/api-reference/series.md
+++ b/docs/api-reference/series.md
@@ -43,6 +43,7 @@
- null_count
- pipe
- quantile
+ - rename
- round
- sample
- scatt... |
narwhals-dev__narwhals-1079 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"narwhals/_dask/group_by.py:DaskLazyGroupBy.__init__"
],
"edited_modules": [
"narwhals/_dask/group_by.py:DaskLazyGroupBy"
]
},
"file": "narwhals/_dask/group_by.py"
},
... | narwhals-dev/narwhals | a8cb962df80df97b2837aaf21db1fe3e827fc119 | [Bug]: pandas-like groupby should use `observed=True` flag
### Describe the bug
Grouping by categorical variables leads to inconsistency between pandas and polars.
Current default pandas behaviour leads to all the category combination to appear, while that's not the case in polars and arrow
### Steps or code t... | diff --git a/narwhals/_dask/group_by.py b/narwhals/_dask/group_by.py
index d5fbaaf9..d79c95d7 100644
--- a/narwhals/_dask/group_by.py
+++ b/narwhals/_dask/group_by.py
@@ -47,6 +47,7 @@ class DaskLazyGroupBy:
self._grouped = self._df._native_frame.groupby(
list(self._keys),
dropna=Fals... |
narwhals-dev__narwhals-108 | [
{
"changes": {
"added_entities": [
"narwhals/_pandas_like/expr.py:PandasExprStringNamespace.to_datetime"
],
"added_modules": null,
"edited_entities": null,
"edited_modules": [
"narwhals/_pandas_like/expr.py:PandasExprStringNamespace"
]
},
"file": "narw... | narwhals-dev/narwhals | 4432bf89036993abc82e7c286d0e0fbc79d2028f | Feature: `Expr.str.to_datetime`
I get that there's a bunch of expressions missing, but I might prioritise this one since it might allow me to do a bunch of featurization tricks in scikit-learn pipelines. | diff --git a/docs/api-reference/expressions_str.md b/docs/api-reference/expressions_str.md
index f8e0cecc..8067dd97 100644
--- a/docs/api-reference/expressions_str.md
+++ b/docs/api-reference/expressions_str.md
@@ -5,5 +5,6 @@
options:
members:
- ends_with
+ - to_datetime
show_source:... |
narwhals-dev__narwhals-1082 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"narwhals/_arrow/namespace.py:ArrowNamespace.mean_horizontal"
],
"edited_modules": [
"narwhals/_arrow/namespace.py:ArrowNamespace"
]
},
"file": "narwhals/_arrow/namespac... | narwhals-dev/narwhals | ca4bf5034e2f1247178ce4d2674f34fd7b7dc83e | bug: `nw.mean_horizontal(nw.all())` raises unnecessarily
Follow-up to https://github.com/narwhals-dev/narwhals/pull/1075 | diff --git a/narwhals/_arrow/namespace.py b/narwhals/_arrow/namespace.py
index 3e7f4ecc..7f0bcbec 100644
--- a/narwhals/_arrow/namespace.py
+++ b/narwhals/_arrow/namespace.py
@@ -215,13 +215,26 @@ class ArrowNamespace:
)
def mean_horizontal(self, *exprs: IntoArrowExpr) -> IntoArrowExpr:
- arrow_e... |
narwhals-dev__narwhals-1090 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"narwhals/_arrow/namespace.py:ArrowNamespace.all_horizontal",
"narwhals/_arrow/namespace.py:ArrowNamespace.any_horizontal",
"narwhals/_arrow/namespace.py:ArrowNamespace.sum_horizontal"
... | narwhals-dev/narwhals | bf55d8109f0a7e073572e405bfb2d48f960d0d00 | [Bug]: Run into safety assertion on `reuse_series_implementation` for drop_nulls
### Describe the bug
When executing `DataFrame.drop_nulls(subset=[...])` we run into safety assertion of `reuse_series_implementation` function
### Steps or code to reproduce the bug
Consider the following tests:
```py
@pytest... | diff --git a/narwhals/_arrow/namespace.py b/narwhals/_arrow/namespace.py
index 6f699fa2..e1fb8c6b 100644
--- a/narwhals/_arrow/namespace.py
+++ b/narwhals/_arrow/namespace.py
@@ -16,6 +16,7 @@ from narwhals._arrow.utils import horizontal_concat
from narwhals._arrow.utils import vertical_concat
from narwhals._expressi... |
narwhals-dev__narwhals-1099 | [
{
"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 | [Bug]: `PandasLikeSeries.zip_with` raises when mask has length 1
### Describe the bug
I encountered this issue while working on plotly integration.
There is a conditional that is applied after a reduction (dataframe of length 1) and ends up raising the following error:
> ValueError: Array conditional must be sam... | 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-1123 | [
{
"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 | 09e184f7d343c28c4f575943d8fc6505581f4b2e | [Bug]: Tuple row value in subset causes odd error
### Describe the bug
Odd edge case
### Steps or code to reproduce the bug
```python
import narwhals.stable.v1 as nw
import palmerpenguins
pd_df = palmerpenguins.load_penguins_raw().iloc[0:2, 0:2]
nw_df = nw.from_native(pd_df, eager_only=True)
# Works
nw_d... | diff --git a/narwhals/_arrow/dataframe.py b/narwhals/_arrow/dataframe.py
index efc34317..a46c6394 100644
--- a/narwhals/_arrow/dataframe.py
+++ b/narwhals/_arrow/dataframe.py
@@ -176,6 +176,10 @@ class ArrowDataFrame:
elif isinstance(item, tuple) and len(item) == 2:
if isinstance(item[1], slice):
... |
narwhals-dev__narwhals-1128 | [
{
"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.concat_str"
],
"add... | narwhals-dev/narwhals | 3e0405d860b5bcd999ea2657b3f1a602f9e6c7dc | [Enh]: Add `nw.concat_str` to horizontally concatenate string columns
### 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?
Plotly needs something like that
### Please describe the purpose of t... | diff --git a/docs/api-reference/narwhals.md b/docs/api-reference/narwhals.md
index 2700c48c..39afb8e8 100644
--- a/docs/api-reference/narwhals.md
+++ b/docs/api-reference/narwhals.md
@@ -11,6 +11,7 @@ Here are the top-level functions available in Narwhals.
- any_horizontal
- col
- concat
+ ... |
narwhals-dev__narwhals-1137 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"narwhals/_arrow/dataframe.py:ArrowDataFrame.unpivot"
],
"edited_modules": [
"narwhals/_arrow/dataframe.py:ArrowDataFrame"
]
},
"file": "narwhals/_arrow/dataframe.py"
... | narwhals-dev/narwhals | bb493c609bbda48ee475435eb629be81697f3964 | [Bug]: when-then-otherwise breaks for pyarrow with `nw.lit`
### Describe the bug
Using `nw.lit` in pyarrow when-then-otherwise raises an exception:
> ArrowInvalid: Array arguments must all be the same length
### Steps or code to reproduce the bug
```py
import pyarrow as pa
import narwhals as nw
data = {"a": ... | diff --git a/docs/backcompat.md b/docs/backcompat.md
index 3c4a19a7..55f31aad 100644
--- a/docs/backcompat.md
+++ b/docs/backcompat.md
@@ -74,8 +74,8 @@ users of `narwhals.stable.v1` will have their code unaffected.
Which should you use? In general we recommend:
- When prototyping, use `import narwhals as nw`, so y... |
narwhals-dev__narwhals-1159 | [
{
"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 | 1abea24fd837f3ac6ccb2ea6e0de60665259a50b | [Enh]: `Series.scatter()` should always return a new `Series`
### 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?
posit-dev/py-shiny
### Please describe the purpose of the new feature or... | diff --git a/narwhals/_pandas_like/dataframe.py b/narwhals/_pandas_like/dataframe.py
index 6e96fb7c..6a629298 100644
--- a/narwhals/_pandas_like/dataframe.py
+++ b/narwhals/_pandas_like/dataframe.py
@@ -355,7 +355,6 @@ class PandasLikeDataFrame:
) -> Self:
index = self._native_frame.index
new_col... |
narwhals-dev__narwhals-1194 | [
{
"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 | 80aad57a3b91b211047936fd75ba1cdd581baaa9 | enh: add `to_py_scalar`
in the plotly PR () we have
```
def to_py_scalar(scalar_like):
"""If scalar is not python native, tries to convert it to python native."""
if hasattr(scalar_like, "as_py"):
return scalar_like.as_py()
elif hasattr(scalar_like, "item"):
return scalar_like.item(... | diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 89d05e54..4d416e23 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -40,7 +40,7 @@ repos:
hooks:
- id: nbstripout
- repo: https://github.com/adamchainz/blacken-docs
- rev: "1.18.0" # replace with latest tag on GitHub
+ ... |
narwhals-dev__narwhals-120 | [
{
"changes": {
"added_entities": [
"narwhals/_pandas_like/expr.py:PandasExprDateTimeNamespace.month",
"narwhals/_pandas_like/expr.py:PandasExprDateTimeNamespace.day",
"narwhals/_pandas_like/expr.py:PandasExprDateTimeNamespace.hour",
"narwhals/_pandas_like/expr.py:PandasExpr... | narwhals-dev/narwhals | 0fdbb1c165caae60cfba8f20ea35fc1ddf8cfeb4 | Add temporal methods
SeCurrently, we have `Expr.dt.year`, and `Series.dt.year`
https://github.com/narwhals-dev/narwhals/blob/81e8f7959c66d0987324e83b33cf5a7b8e1c2b6e/tests/test_dt.py#L18-L26
We should also add:
- dt.millisecond
- dt.microsecond
- dt.nanosecond
- dt.total_seconds
- dt.total_milliseconds
- ... | diff --git a/docs/api-reference/expressions_dt.md b/docs/api-reference/expressions_dt.md
index 955e3fe5..0ac984c1 100644
--- a/docs/api-reference/expressions_dt.md
+++ b/docs/api-reference/expressions_dt.md
@@ -5,5 +5,11 @@
options:
members:
- year
+ - month
+ - day
+ - ordinal... |
narwhals-dev__narwhals-1201 | [
{
"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 | 9b628ee06f39b7649b071e94c3a663a8c758c46d | [Bug]: narwhals.DataFrame.with_columns changes types for single row dataframes
### Describe the bug
Example below of single row pandas df with categorical column 'a' being put through narwhals and returned with 'a' converted to float type, ideal behaviour would be for this to preserve type
### Steps or code to reprod... | diff --git a/docs/api-reference/narwhals.md b/docs/api-reference/narwhals.md
index 044b20e0..b8ec2d79 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.
- concat_str
- from_dict
- from_nati... |
narwhals-dev__narwhals-1210 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"narwhals/_arrow/series.py:ArrowSeriesDateTimeNamespace.date"
],
"edited_modules": [
"narwhals/_arrow/series.py:ArrowSeriesDateTimeNamespace"
]
},
"file": "narwhals/_arr... | narwhals-dev/narwhals | 90836bd7bc428d610cab8a65316aaedee3febe53 | test: use `constructor_eager` instead of parametrising over example dataframes
There's still some cases in the test suite where we're parametrising over dataframes instead of using `constructor` / `constructor_eager`:
The task is:
- look for instances of `df_pandas = ` in the `tests` folder. e.g.: https://github.co... | diff --git a/narwhals/_arrow/series.py b/narwhals/_arrow/series.py
index 65a393ca..2eb73829 100644
--- a/narwhals/_arrow/series.py
+++ b/narwhals/_arrow/series.py
@@ -784,7 +784,7 @@ class ArrowSeriesDateTimeNamespace:
import pyarrow as pa # ignore-banned-import()
return self._arrow_series._from_na... |
narwhals-dev__narwhals-1220 | [
{
"changes": {
"added_entities": [
"narwhals/_arrow/expr.py:ArrowExprDateTimeNamespace.timestamp"
],
"added_modules": null,
"edited_entities": null,
"edited_modules": [
"narwhals/_arrow/expr.py:ArrowExprDateTimeNamespace"
]
},
"file": "narwhals/_arrow/... | narwhals-dev/narwhals | 6af79b40b8f66a0d5d9bb5a15d9c195b85988a92 | enh: add dt.timestamp
Here's the Polars method: https://docs.pola.rs/py-polars/html/reference/expressions/api/polars.Expr.dt.timestamp.html
We should add this to Narwhals for use in Plotly | diff --git a/docs/api-reference/expr_dt.md b/docs/api-reference/expr_dt.md
index 5c9ab41f..604ac4ab 100644
--- a/docs/api-reference/expr_dt.md
+++ b/docs/api-reference/expr_dt.md
@@ -6,22 +6,23 @@
members:
- convert_time_zone
- date
- - year
- - month
- day
- - ord... |
narwhals-dev__narwhals-1246 | [
{
"changes": {
"added_entities": [
"narwhals/utils.py:_has_default_index"
],
"added_modules": [
"narwhals/utils.py:_has_default_index"
],
"edited_entities": [
"narwhals/utils.py:maybe_reset_index"
],
"edited_modules": [
"narwhals/utils.py... | narwhals-dev/narwhals | f6b47c9a84de8533ccb66e66b93d2c23dc393e41 | perf: make `maybe_reset_index` a no-op if object has default index
In pandas < 3.0 without copy-on-write enabled, `reset_index` always creates a copy. This makes sense in pandas, as the pandas api has quite a few in-place methods
In the Narwhals API, we have zero in-place methods, so we can optimise `maybe_reset_ind... | diff --git a/narwhals/utils.py b/narwhals/utils.py
index 37cce17d..34b45447 100644
--- a/narwhals/utils.py
+++ b/narwhals/utils.py
@@ -31,6 +31,7 @@ from narwhals.translate import to_native
if TYPE_CHECKING:
from types import ModuleType
+ import pandas as pd
from typing_extensions import Self
from ... |
narwhals-dev__narwhals-1257 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"narwhals/_arrow/dataframe.py:ArrowDataFrame.group_by"
],
"edited_modules": [
"narwhals/_arrow/dataframe.py:ArrowDataFrame"
]
},
"file": "narwhals/_arrow/dataframe.py"
... | narwhals-dev/narwhals | 72a867832bc07a2aa5fc8a769786f88e3a7e30dc | feat(?): drop_null_keys in group_by?
In https://github.com/plotly/plotly.py/pull/4790#pullrequestreview-2396362856 I noticed that iterating over groups in pandas is noticeably faster with `dropna=True` (the default), as opposed to `dropna=False`
Options to address that could be:
1) add a `drop_null_keys` option to ... | diff --git a/narwhals/_arrow/dataframe.py b/narwhals/_arrow/dataframe.py
index 6b87f1d8..b5de5701 100644
--- a/narwhals/_arrow/dataframe.py
+++ b/narwhals/_arrow/dataframe.py
@@ -335,10 +335,10 @@ class ArrowDataFrame:
df = self._native_frame.__class__.from_arrays(to_concat, names=output_names)
return... |
narwhals-dev__narwhals-1264 | [
{
"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 | c0a26beb811345b5459b6a239ae9b56e998ceb31 | feat: make `generate_unique_token` public, document it + add examples
This is a useful utility function, which is making an appearance in the Plotly PR
So, I think we should make it public, it'll likely be useful in other places | diff --git a/docs/api-reference/narwhals.md b/docs/api-reference/narwhals.md
index c4b04a2f..2b5be6e8 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.
- from_dict
- from_native
- from_arr... |
narwhals-dev__narwhals-1268 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"narwhals/_pandas_like/dataframe.py:PandasLikeDataFrame.__init__",
"narwhals/_pandas_like/dataframe.py:PandasLikeDataFrame.schema"
],
"edited_modules": [
"narwhals/_pandas_lik... | narwhals-dev/narwhals | 0b333f99a1aaf03d8934318601c7738b75212cf0 | [Bug]: Series.dtype might be incorrect after inplace modification of pandas series
### Describe the bug
```
In [1]: import narwhals as nw
In [2]: import pandas as pd
In [3]: s = pd.Series([1,2,3])
In [4]: snw = nw.from_native(s, series_only=True)
In [5]: snw.dtype
Out[5]: Int64
In [6]: s[0] = 999.5
<... | diff --git a/narwhals/_pandas_like/dataframe.py b/narwhals/_pandas_like/dataframe.py
index 50b309d4..bb60de12 100644
--- a/narwhals/_pandas_like/dataframe.py
+++ b/narwhals/_pandas_like/dataframe.py
@@ -54,8 +54,6 @@ class PandasLikeDataFrame:
self._backend_version = backend_version
self._dtypes = dty... |
narwhals-dev__narwhals-1280 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"narwhals/translate.py:_from_native_impl"
],
"edited_modules": [
"narwhals/translate.py:_from_native_impl"
]
},
"file": "narwhals/translate.py"
}
] | narwhals-dev/narwhals | acfaadcbcbd9e75b47f1e57ff3ee3ed8263f0397 | err: replace msg = "Please set `allow_series=True`" with msg = "Please set `allow_series=True` or `series_only=True`" | diff --git a/narwhals/translate.py b/narwhals/translate.py
index d439890c..075f9b3a 100644
--- a/narwhals/translate.py
+++ b/narwhals/translate.py
@@ -429,7 +429,7 @@ def _from_native_impl( # noqa: PLR0915
elif hasattr(native_object, "__narwhals_series__"):
if not allow_series:
if strict:
- ... |
narwhals-dev__narwhals-1283 | [
{
"changes": {
"added_entities": [
"narwhals/_interchange/dataframe.py:InterchangeFrame.select"
],
"added_modules": null,
"edited_entities": [
"narwhals/_interchange/dataframe.py:InterchangeFrame.__init__",
"narwhals/_interchange/dataframe.py:InterchangeFrame.sche... | narwhals-dev/narwhals | f349cb2a944316d0a10153cc05d86db855d43562 | enh: add `select` to `InterchangeFrame`
We should allow for selecting columns by name in `InterchangeFrame`, falling back to `select_columns_by_name` for generic dataframe interchange protocol implementers | diff --git a/narwhals/_interchange/dataframe.py b/narwhals/_interchange/dataframe.py
index 4e8e542e..dc2af3ba 100644
--- a/narwhals/_interchange/dataframe.py
+++ b/narwhals/_interchange/dataframe.py
@@ -75,7 +75,6 @@ def map_interchange_dtype_to_narwhals_dtype(
class InterchangeFrame:
def __init__(self, df: Any... |
narwhals-dev__narwhals-1303 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"narwhals/_pandas_like/dataframe.py:PandasLikeDataFrame.to_numpy"
],
"edited_modules": [
"narwhals/_pandas_like/dataframe.py:PandasLikeDataFrame"
]
},
"file": "narwhals/... | narwhals-dev/narwhals | 5c3db5b149cbf64b97de49bc4ad726f019f9f578 | bug: fixedoffset time zone results in Unknown Narwhals dtype
```python
In [4]: nw.from_native(pd.Series(pd.to_datetime(['2020-01-01T00:00+01:00'])), series_only=True).dtype
Out[4]: Unknown
```
Expected:
```
Datetime(time_unit='ns', time_zone='+01:00')
``` | diff --git a/narwhals/_pandas_like/dataframe.py b/narwhals/_pandas_like/dataframe.py
index 7be808af..796386fa 100644
--- a/narwhals/_pandas_like/dataframe.py
+++ b/narwhals/_pandas_like/dataframe.py
@@ -698,21 +698,36 @@ class PandasLikeDataFrame:
# pandas default differs from Polars, but cuDF default is T... |
narwhals-dev__narwhals-1304 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"narwhals/translate.py:to_py_scalar"
],
"edited_modules": [
"narwhals/translate.py:to_py_scalar"
]
},
"file": "narwhals/translate.py"
}
] | narwhals-dev/narwhals | 5c3db5b149cbf64b97de49bc4ad726f019f9f578 | bug: `to_py_scalar` converts `np.datetime64` to `int`
```python
In [8]: nw.to_py_scalar(np.datetime64('2000-01-01', 'ns'))
Out[8]: 946684800000000000
In [9]: nw.to_py_scalar(np.datetime64('2000-01-01', 'us'))
Out[9]: datetime.datetime(2000, 1, 1, 0, 0)
```
I think both should get converted to `datetime.dateti... | diff --git a/narwhals/translate.py b/narwhals/translate.py
index 075f9b3a..65cc4422 100644
--- a/narwhals/translate.py
+++ b/narwhals/translate.py
@@ -857,6 +857,13 @@ def to_py_scalar(scalar_like: Any) -> Any:
return scalar_like
np = get_numpy()
+ if (
+ np
+ and isinstance(scalar_like... |
narwhals-dev__narwhals-1330 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"narwhals/_arrow/expr.py:ArrowExpr.unique"
],
"edited_modules": [
"narwhals/_arrow/expr.py:ArrowExpr"
]
},
"file": "narwhals/_arrow/expr.py"
},
{
"changes": {
... | narwhals-dev/narwhals | 0aeb884f4f5a13c2b09bdbe664c7778a560c0158 | [Enh]: allow passing index object directly to `maybe_set_index`
### 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 describ... | diff --git a/README.md b/README.md
index 0f1f904f..9308af7c 100644
--- a/README.md
+++ b/README.md
@@ -121,6 +121,9 @@ to this list!
Narwhals has been featured in several talks, podcasts, and blog posts:
+- [The Real Python Podcast](https://www.youtube.com/watch?v=w5DFZbFYzCM)
+ Narwhals: Expanding DataFrame Comp... |
narwhals-dev__narwhals-1333 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"narwhals/_arrow/expr.py:ArrowExpr.unique"
],
"edited_modules": [
"narwhals/_arrow/expr.py:ArrowExpr"
]
},
"file": "narwhals/_arrow/expr.py"
},
{
"changes": {
... | narwhals-dev/narwhals | d35a8e573a03efc233f84fd9922a69c783637f01 | enh: add `maintain_order` to Expr.unique and Series.unique
As requested here https://github.com/plotly/plotly.py/pull/4790#issuecomment-2459974589
We already have `maintain_order` for `DataFrame.unique`, my concern is that for some libraries this may turn out to not be guaranteed (and for there to not be any option ... | diff --git a/narwhals/_arrow/dataframe.py b/narwhals/_arrow/dataframe.py
index ac845853..a357bdeb 100644
--- a/narwhals/_arrow/dataframe.py
+++ b/narwhals/_arrow/dataframe.py
@@ -621,7 +621,7 @@ class ArrowDataFrame:
) -> Self:
"""
NOTE:
- The param `maintain_order` is only here for co... |
narwhals-dev__narwhals-1341 | [
{
"changes": {
"added_entities": [
"narwhals/_arrow/expr.py:ArrowExpr.is_finite"
],
"added_modules": null,
"edited_entities": null,
"edited_modules": [
"narwhals/_arrow/expr.py:ArrowExpr"
]
},
"file": "narwhals/_arrow/expr.py"
},
{
"changes": {... | narwhals-dev/narwhals | 68e9bbe5489258b848f294ecc824d2d7ad75ba18 | [Enh]: Add support for `Series|Expr.is_finite`
### 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?
Noticed in the [inline comment](https://github.com/lvgig/tubular/pull/339/files#diff-47c01081... | diff --git a/docs/api-reference/expr.md b/docs/api-reference/expr.md
index 867702b6..1dfde821 100644
--- a/docs/api-reference/expr.md
+++ b/docs/api-reference/expr.md
@@ -25,6 +25,7 @@
- clip
- is_between
- is_duplicated
+ - is_finite
- is_first_distinct
- is_in
... |
narwhals-dev__narwhals-1395 | [
{
"changes": {
"added_entities": [
"narwhals/_arrow/expr.py:ArrowExpr.rolling_sum"
],
"added_modules": null,
"edited_entities": null,
"edited_modules": [
"narwhals/_arrow/expr.py:ArrowExpr"
]
},
"file": "narwhals/_arrow/expr.py"
},
{
"changes":... | narwhals-dev/narwhals | 836f08680b727f12ff0af621fe9492b6e757a0c4 | api: "unstable" features
I'm slightly hesitant about how to merge #1298 and #1290 - rolling_mean is marked as unstable in Polars. ewm_mean isn't, but follows the api kind of API style
I do think we should merge them, I just think we need a way to signal that we won't make the same kinds of promises for them as we do... | diff --git a/docs/api-reference/exceptions.md b/docs/api-reference/exceptions.md
index b6841597..e37b0f3e 100644
--- a/docs/api-reference/exceptions.md
+++ b/docs/api-reference/exceptions.md
@@ -7,5 +7,6 @@
- ColumnNotFoundError
- InvalidIntoExprError
- InvalidOperationError
+ - Narwha... |
narwhals-dev__narwhals-1424 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"narwhals/_arrow/expr.py:ArrowExpr.__rand__",
"narwhals/_arrow/expr.py:ArrowExpr.__ror__",
"narwhals/_arrow/expr.py:ArrowExpr.__radd__",
"narwhals/_arrow/expr.py:ArrowExpr.__rsub_... | narwhals-dev/narwhals | ea1a64fcd5a1a01202b878648c51944d524bdd3a | [Bug]: `lit` does not "broadcast" as expected
### Describe the bug
Narwhals implementation of `lit` breaks when it is the left most expr.
Figured this out while doing a fold starting with a lit initial value.
### Steps or code to reproduce the bug
```py
import narwhals as nw
import pandas as pd
import polars a... | diff --git a/narwhals/_arrow/expr.py b/narwhals/_arrow/expr.py
index 2cae743f..1cb0a068 100644
--- a/narwhals/_arrow/expr.py
+++ b/narwhals/_arrow/expr.py
@@ -151,55 +151,64 @@ class ArrowExpr:
return reuse_series_implementation(self, "__and__", other=other)
def __rand__(self: Self, other: ArrowExpr | b... |
narwhals-dev__narwhals-1425 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"narwhals/_arrow/dataframe.py:ArrowDataFrame.filter"
],
"edited_modules": [
"narwhals/_arrow/dataframe.py:ArrowDataFrame"
]
},
"file": "narwhals/_arrow/dataframe.py"
}... | narwhals-dev/narwhals | 6946e26c1e6d3b5663d849534a4bfcfd9b82d1cb | docs: bikeshed on good name for example function in docs
Related to https://github.com/narwhals-dev/narwhals/pull/1406#issuecomment-2486295148
Currently the docstring examples of use `func` or `my_library_agnostic_function`
Let's discuss on Friday's call what to name the functions
In the meantime I'm pretty ke... | diff --git a/narwhals/_arrow/dataframe.py b/narwhals/_arrow/dataframe.py
index 2ae8d761..83a8c57b 100644
--- a/narwhals/_arrow/dataframe.py
+++ b/narwhals/_arrow/dataframe.py
@@ -1,5 +1,6 @@
from __future__ import annotations
+from itertools import chain
from typing import TYPE_CHECKING
from typing import Any
fro... |
narwhals-dev__narwhals-143 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"narwhals/_pandas_like/series.py:PandasSeries.n_unique"
],
"edited_modules": [
"narwhals/_pandas_like/series.py:PandasSeries"
]
},
"file": "narwhals/_pandas_like/series.... | narwhals-dev/narwhals | b22fc47f6ca376fa0ae9115800fa9b8ddfdbe99b | `n_unique`: pandas skips nulls, polars counts
we may need some additional logic under the hood to align them here:
```python
In [30]: pl.Series([1., None, None, 2.]).n_unique()
Out[30]: 3
In [31]: pd.Series([1., None, None, 2.]).nunique()
Out[31]: 2
``` | diff --git a/narwhals/_pandas_like/series.py b/narwhals/_pandas_like/series.py
index 854ba161..897e7ffc 100644
--- a/narwhals/_pandas_like/series.py
+++ b/narwhals/_pandas_like/series.py
@@ -346,7 +346,7 @@ class PandasSeries:
def n_unique(self) -> int:
ser = self._series
- return ser.nunique() ... |
narwhals-dev__narwhals-1432 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"narwhals/_arrow/series.py:ArrowSeries.any",
"narwhals/_arrow/series.py:ArrowSeries.all",
"narwhals/_arrow/series.py:ArrowSeries.is_sorted"
],
"edited_modules": [
"nar... | narwhals-dev/narwhals | 35c34f482cbdfaf6510b6ffce910226b16b65e85 | RFC: Series aggregations which return booleans should always return Python booleans
In general, we're trying to let libraries handle their own scalars, so that they can choose to preserve precision or keep data on a different device
But, for functions which aggregate to a single boolean, I think we should just retur... | diff --git a/narwhals/_arrow/series.py b/narwhals/_arrow/series.py
index ee06f1fa..f286b300 100644
--- a/narwhals/_arrow/series.py
+++ b/narwhals/_arrow/series.py
@@ -14,6 +14,7 @@ from narwhals._arrow.utils import narwhals_to_native_dtype
from narwhals._arrow.utils import native_to_narwhals_dtype
from narwhals._arro... |
narwhals-dev__narwhals-1455 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"narwhals/_arrow/namespace.py:ArrowNamespace.concat"
],
"edited_modules": [
"narwhals/_arrow/namespace.py:ArrowNamespace"
]
},
"file": "narwhals/_arrow/namespace.py"
}... | narwhals-dev/narwhals | 8aa4937e57b562532b0a7d99fba57860effc4dfd | enh: `how='diagonal'` in `concat`
This would also be useful in Prophet...not essential, but it would reduce the diff
check the description here https://docs.pola.rs/api/python/stable/reference/api/polars.concat.html | diff --git a/README.md b/README.md
index a7a08188..6133a0ed 100644
--- a/README.md
+++ b/README.md
@@ -42,6 +42,7 @@ Get started!
Join the party!
- [altair](https://github.com/vega/altair/)
+- [hierarchicalforecast](https://github.com/Nixtla/hierarchicalforecast)
- [marimo](https://github.com/marimo-team/marimo)
... |
narwhals-dev__narwhals-1456 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": null,
"edited_modules": null
},
"file": "narwhals/__init__.py"
},
{
"changes": {
"added_entities": [
"narwhals/functions.py:from_numpy",
"narwhals/functions.py:_from_num... | narwhals-dev/narwhals | 58256d6b5136468968fbc638eab8ece280099e6f | enh: create dataframe from 2D numpy array and column names
For classical numpy dtypes in pandas, this should be more efficient than forcing slices + dicts
Spotted in Prophet
Desired syntax:
```python
import narwhals as nw
import numpy as np
import pandas as pd
arr = np.zeros([[1,2,3], [4,5,6]])
df = nw.fr... | diff --git a/docs/api-reference/narwhals.md b/docs/api-reference/narwhals.md
index 165af7f3..d1423b9c 100644
--- a/docs/api-reference/narwhals.md
+++ b/docs/api-reference/narwhals.md
@@ -12,9 +12,10 @@ Here are the top-level functions available in Narwhals.
- col
- concat
- concat_str
+ ... |
narwhals-dev__narwhals-1458 | [
{
"changes": {
"added_entities": [
"narwhals/_arrow/dataframe.py:ArrowDataFrame._change_dtypes"
],
"added_modules": null,
"edited_entities": null,
"edited_modules": [
"narwhals/_arrow/dataframe.py:ArrowDataFrame"
]
},
"file": "narwhals/_arrow/dataframe... | narwhals-dev/narwhals | 14a5f846df064ee1e83759c9c6d73eb12e679bf4 | [Bug]: `from_dict` doesn't preserve dtype module
### Describe the bug
`from_dict` when called from `nw.stable.v1` doesn't result in `stable.v1` dtypes
### Steps or code to reproduce the bug
```python
from __future__ import annotations
import narwhals.stable.v1 as nw
from narwhals.typing import IntoFrameT
from ... | diff --git a/narwhals/_arrow/dataframe.py b/narwhals/_arrow/dataframe.py
index 83a8c57b..563d918c 100644
--- a/narwhals/_arrow/dataframe.py
+++ b/narwhals/_arrow/dataframe.py
@@ -69,6 +69,11 @@ class ArrowDataFrame:
def __narwhals_lazyframe__(self) -> Self:
return self
+ def _change_dtypes(self, dtyp... |
narwhals-dev__narwhals-1475 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"narwhals/functions.py:_from_dict_impl"
],
"edited_modules": [
"narwhals/functions.py:_from_dict_impl"
]
},
"file": "narwhals/functions.py"
}
] | narwhals-dev/narwhals | 87d7e668eb301e6f9cd90ef8aff9d8a0bf0d8960 | bug: `from_dict` uses pandas' index alignment rules (as opposed to Narwhals)
```python
In [3]: import narwhals as nw
...:
...: df = pd.DataFrame({'a': [1,2,3], 'b': [4,5,6]})
...:
...: print(nw.from_dict({'a': df['a'], 'b': df['a'].sort_values(ascending=False)}, native_namespace=pd).to_native())
... | diff --git a/.github/workflows/extremes.yml b/.github/workflows/extremes.yml
index 4b89bb63..3db40715 100644
--- a/.github/workflows/extremes.yml
+++ b/.github/workflows/extremes.yml
@@ -92,7 +92,7 @@ jobs:
matrix:
python-version: ["3.13"]
os: [ubuntu-latest]
- if: github.event.pull_request.... |
narwhals-dev__narwhals-1480 | [
{
"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.__contains__"
],
"added_m... | narwhals-dev/narwhals | 7d9fe7ee6d140ca0ff05bf7c339ac8163dfd9eae | enh: implement `__contains__` for Series
As brought up in https://github.com/narwhals-dev/narwhals/issues/1443#issuecomment-2508932494 | diff --git a/narwhals/__init__.py b/narwhals/__init__.py
index 815c0675..7b2b017b 100644
--- a/narwhals/__init__.py
+++ b/narwhals/__init__.py
@@ -31,22 +31,22 @@ from narwhals.dtypes import UInt32
from narwhals.dtypes import UInt64
from narwhals.dtypes import Unknown
from narwhals.expr import Expr
-from narwhals.ex... |
narwhals-dev__narwhals-1515 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"narwhals/_pandas_like/series.py:PandasLikeSeries.__getitem__"
],
"edited_modules": [
"narwhals/_pandas_like/series.py:PandasLikeSeries"
]
},
"file": "narwhals/_pandas_l... | narwhals-dev/narwhals | 1d9ac1c8adb745baa27df935fe2e41cf4e423b2a | bug: can't use `Series.__getitem__` with numpy scalars
The consequence of this is:
```python
In [18]: import pandas as pd
In [19]: import narwhals as nw
In [20]: s = pd.Series([0,1,2])
In [21]: snw = nw.from_native(s, series_only=True)
In [22]: snw[snw.min()]
---------------------------------------------... | diff --git a/narwhals/_pandas_like/series.py b/narwhals/_pandas_like/series.py
index 303583a9..bd799039 100644
--- a/narwhals/_pandas_like/series.py
+++ b/narwhals/_pandas_like/series.py
@@ -19,6 +19,7 @@ from narwhals._pandas_like.utils import rename
from narwhals._pandas_like.utils import select_columns_by_name
fro... |
narwhals-dev__narwhals-1529 | [
{
"changes": {
"added_entities": [
"narwhals/_arrow/expr.py:ArrowExpr.arg_min",
"narwhals/_arrow/expr.py:ArrowExpr.arg_max"
],
"added_modules": null,
"edited_entities": null,
"edited_modules": [
"narwhals/_arrow/expr.py:ArrowExpr"
]
},
"file": ... | narwhals-dev/narwhals | d0225b3359c302d56420c042655b4aee7390d283 | feat: Series.arg_min, Series.arg_max, Expr.arg_min, Expr.arg_max
These would all be useful in Prophet, I think we should add them | diff --git a/docs/api-reference/expr.md b/docs/api-reference/expr.md
index 91f49a0a..61901a99 100644
--- a/docs/api-reference/expr.md
+++ b/docs/api-reference/expr.md
@@ -8,6 +8,8 @@
- alias
- all
- any
+ - arg_max
+ - arg_min
- arg_true
- cast
- count... |
narwhals-dev__narwhals-1544 | [
{
"changes": {
"added_entities": [
"narwhals/dependencies.py:is_narwhals_dataframe",
"narwhals/dependencies.py:is_narwhals_lazyframe",
"narwhals/dependencies.py:is_narwhals_series"
],
"added_modules": [
"narwhals/dependencies.py:is_narwhals_dataframe",
"... | narwhals-dev/narwhals | d788eece6f1bee9e21d3840e1ec9e25799504331 | [Doc]: Add a docstring example in `narwhals.dtypes` for Datetime - beginner friendly
### What type of report is this?
Improvement
### Please describe the issue.
Thank you for contributing to Narwhals
May the Undwerwater Unicorn Magic be with You! 🌊🦄
Add a docstring example for Datetime - dtype, that will be vi... | diff --git a/narwhals/dependencies.py b/narwhals/dependencies.py
index 463a64a6..61937f08 100644
--- a/narwhals/dependencies.py
+++ b/narwhals/dependencies.py
@@ -24,6 +24,9 @@ if TYPE_CHECKING:
import pyarrow as pa
import pyspark.sql as pyspark_sql
+ from narwhals.dataframe import DataFrame
+ from na... |
narwhals-dev__narwhals-1549 | [
{
"changes": {
"added_entities": [
"narwhals/_arrow/dataframe.py:ArrowDataFrame.estimated_size"
],
"added_modules": null,
"edited_entities": null,
"edited_modules": [
"narwhals/_arrow/dataframe.py:ArrowDataFrame"
]
},
"file": "narwhals/_arrow/dataframe... | narwhals-dev/narwhals | d788eece6f1bee9e21d3840e1ec9e25799504331 | [Enh]: Add `estimated_size`
### 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?
https://github.com/mwouts/itables
### 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 883fb789..c93862f2 100644
--- a/docs/api-reference/dataframe.md
+++ b/docs/api-reference/dataframe.md
@@ -11,6 +11,7 @@
- columns
- drop
- drop_nulls
+ - estimated_size
- filter
- gat... |
narwhals-dev__narwhals-1550 | [
{
"changes": {
"added_entities": [
"narwhals/dependencies.py:is_narwhals_dataframe",
"narwhals/dependencies.py:is_narwhals_lazyframe",
"narwhals/dependencies.py:is_narwhals_series"
],
"added_modules": [
"narwhals/dependencies.py:is_narwhals_dataframe",
"... | narwhals-dev/narwhals | d788eece6f1bee9e21d3840e1ec9e25799504331 | enh: `nw.dependencies.is_narwhals_dataframe` / `nw.dependencies.is_narwhals_lazyframe` / `nw.dependencies.is_narwhals_series`
We have functions such as `nw.dependencies.is_pandas_dataframe`
We should add the three mentioned here:
- `nw.dependencies.is_narwhals_dataframe`
- `nw.dependencies.is_narwhals_lazyframe`
... | diff --git a/narwhals/dependencies.py b/narwhals/dependencies.py
index 463a64a6..61937f08 100644
--- a/narwhals/dependencies.py
+++ b/narwhals/dependencies.py
@@ -24,6 +24,9 @@ if TYPE_CHECKING:
import pyarrow as pa
import pyspark.sql as pyspark_sql
+ from narwhals.dataframe import DataFrame
+ from na... |
narwhals-dev__narwhals-1565 | [
{
"changes": {
"added_entities": [
"narwhals/_arrow/expr.py:ArrowExpr.var"
],
"added_modules": null,
"edited_entities": [
"narwhals/_arrow/expr.py:ArrowExpr.std"
],
"edited_modules": [
"narwhals/_arrow/expr.py:ArrowExpr"
]
},
"file": "nar... | narwhals-dev/narwhals | 6a0c43e1c2a599146bfdabee90ae7e73a48022ce | [Bug]: cum_sum expression raises an exception with pandas when 'over' is used
### Describe the bug
The `cum_sum` expression raises an exception when used with the `over` expression.
I did a quick review of the code and I believe this issue can be resolved by simply adding the cum_sum expression name to the dictiona... | diff --git a/docs/api-reference/expr.md b/docs/api-reference/expr.md
index 61901a99..523a45f0 100644
--- a/docs/api-reference/expr.md
+++ b/docs/api-reference/expr.md
@@ -58,5 +58,6 @@
- sum
- tail
- unique
+ - var
show_source: false
show_bases: false
diff --git a/docs/ap... |
narwhals-dev__narwhals-1584 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"narwhals/_arrow/group_by.py:get_function_name_option",
"narwhals/_arrow/group_by.py:agg_arrow"
],
"edited_modules": [
"narwhals/_arrow/group_by.py:get_function_name_option",
... | narwhals-dev/narwhals | d995d2c89984520ee247e278f7d9f7fff404037e | [Bug]: Pandas Dataframe as native does not work with .shift().over()
### Describe the bug
The below code works if the native dataframe is polars. However, getting an error message using pandas.
### Steps or code to reproduce the bug
```
import polars as pl
import narwhals as nw
from narwhals.typing import FrameT
... | diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
index fea1d6b0..e19d9a7f 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.yml
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -58,4 +58,4 @@ body:
attributes:
label: Relevant log output
description: Please copy and past... |
narwhals-dev__narwhals-1603 | [
{
"changes": {
"added_entities": [
"narwhals/_arrow/expr.py:ArrowExpr.var"
],
"added_modules": null,
"edited_entities": [
"narwhals/_arrow/expr.py:ArrowExpr.std"
],
"edited_modules": [
"narwhals/_arrow/expr.py:ArrowExpr"
]
},
"file": "nar... | narwhals-dev/narwhals | 6a0c43e1c2a599146bfdabee90ae7e73a48022ce | test: test group_by(...).agg(nw.col(...).var())
Realised today that we don't have any tests for `df.group_by(...).agg(nw.col(...).var())`. Let's add one!
This should be very similar to the std one:
https://github.com/narwhals-dev/narwhals/blob/44cf9e39840f85901d39f8f44b24b6ea39050c3b/tests/group_by_test.py#L130-L... | diff --git a/docs/api-reference/expr.md b/docs/api-reference/expr.md
index 61901a99..523a45f0 100644
--- a/docs/api-reference/expr.md
+++ b/docs/api-reference/expr.md
@@ -58,5 +58,6 @@
- sum
- tail
- unique
+ - var
show_source: false
show_bases: false
diff --git a/docs/ap... |
narwhals-dev__narwhals-1613 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"narwhals/_arrow/group_by.py:ArrowGroupBy.agg",
"narwhals/_arrow/group_by.py:agg_arrow"
],
"edited_modules": [
"narwhals/_arrow/group_by.py:ArrowGroupBy",
"narwhals/_a... | narwhals-dev/narwhals | 79de45774925b5dcdea17c3e1fda1aeac38d8c18 | bug: pyarrow backend raises with `.group_by('a').agg(c=nw.col('b').sum(), d=nw.col('b').sum())`
```python
import pyarrow as pa
import narwhals as nw
import pandas as pd
import polars as pl
data = {"a": [1, 1, 1, 1, 1, 2, 2, 2, 2, 2], "b": list(range(10))}
nw.from_native(pa.table(data)).group_by('a').agg(c=nw.... | diff --git a/.github/workflows/extremes.yml b/.github/workflows/extremes.yml
index b1939004..84a0cb2c 100644
--- a/.github/workflows/extremes.yml
+++ b/.github/workflows/extremes.yml
@@ -25,12 +25,10 @@ jobs:
cache-suffix: ${{ matrix.python-version }}
cache-dependency-glob: "pyproject.toml"
... |
narwhals-dev__narwhals-1627 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"narwhals/_pandas_like/expr.py:PandasLikeExpr.over"
],
"edited_modules": [
"narwhals/_pandas_like/expr.py:PandasLikeExpr"
]
},
"file": "narwhals/_pandas_like/expr.py"
... | narwhals-dev/narwhals | ccf30e27ac1c14c68cb41b86062c793449ebe48f | enh: support `nw.col('a').shift(n).over('b')`
We now support cumulative operations in `over` for pandas and Polars
We should do the same for `shift`, as pandas also supports that. One challenge will be figuring out how to pass the argument down, but it should be doable
cc @ClaudioSalvatoreArcidiacono in case this... | diff --git a/narwhals/_pandas_like/expr.py b/narwhals/_pandas_like/expr.py
index e7e98d99..07543011 100644
--- a/narwhals/_pandas_like/expr.py
+++ b/narwhals/_pandas_like/expr.py
@@ -24,7 +24,7 @@ if TYPE_CHECKING:
from narwhals.utils import Implementation
from narwhals.utils import Version
-CUMULATIVE_FUNC... |
narwhals-dev__narwhals-1646 | [
{
"changes": {
"added_entities": [
"narwhals/_duckdb/dataframe.py:DuckDBInterchangeFrame.collect_schema"
],
"added_modules": null,
"edited_entities": null,
"edited_modules": [
"narwhals/_duckdb/dataframe.py:DuckDBInterchangeFrame"
]
},
"file": "narwhal... | narwhals-dev/narwhals | 45f48f4bb8e0cf428ca0175ddafbd0d4c8112825 | enh: support `.collect_schema` for interchange-level dataframe
Currently we can only use `.schema`. We should definitely support `.collect_schema` as well
The following should work:
```python
import narwhals as nw
import duckdb
import polars as pl
df = pl.DataFrame({'a': [1,2,3]})
rel = duckdb.table('df')
... | diff --git a/narwhals/_duckdb/dataframe.py b/narwhals/_duckdb/dataframe.py
index fe4a5856..339fca13 100644
--- a/narwhals/_duckdb/dataframe.py
+++ b/narwhals/_duckdb/dataframe.py
@@ -151,3 +151,11 @@ class DuckDBInterchangeFrame:
def _from_native_frame(self: Self, df: Any) -> Self:
return self.__class__... |
narwhals-dev__narwhals-1652 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"narwhals/_arrow/namespace.py:ArrowWhen.__call__"
],
"edited_modules": [
"narwhals/_arrow/namespace.py:ArrowWhen"
]
},
"file": "narwhals/_arrow/namespace.py"
},
{
... | narwhals-dev/narwhals | 82ab5fbfc948c51f0d1cf2cd03fa7ea241f6ed16 | ci: use environment variables instead of contexts in `publish_to_pypi.yml`
We should apply the same diff from https://github.com/pypa/packaging.python.org/pull/1765/files to our [publish_to_pypi.yml](https://github.com/narwhals-dev/narwhals/blob/main/.github/workflows/publish_to_pypi.yml) file | diff --git a/.github/workflows/check_tpch_queries.yml b/.github/workflows/check_tpch_queries.yml
index d98d205b..888f4004 100644
--- a/.github/workflows/check_tpch_queries.yml
+++ b/.github/workflows/check_tpch_queries.yml
@@ -25,7 +25,7 @@ jobs:
cache-suffix: ${{ matrix.python-version }}
cache-de... |
narwhals-dev__narwhals-1663 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"narwhals/_arrow/dataframe.py:ArrowDataFrame.unique"
],
"edited_modules": [
"narwhals/_arrow/dataframe.py:ArrowDataFrame"
]
},
"file": "narwhals/_arrow/dataframe.py"
}... | narwhals-dev/narwhals | b8d0b12abd25d5994f2d1c4f5f06a3611e8fe134 | [Enh]: TODO: ArrowSeriesCatNamespace has an operation that is potentially expensive
### 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/_arrow/series.py#L179-L190)
``... | diff --git a/docs/how_it_works.md b/docs/how_it_works.md
index 70bc54bf..6a670358 100644
--- a/docs/how_it_works.md
+++ b/docs/how_it_works.md
@@ -266,7 +266,6 @@ In order to tell whether an aggregation is simple, Narwhals uses the private `_d
```python exec="1" result="python" session="pandas_impl" source="above"
pr... |
narwhals-dev__narwhals-1672 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"narwhals/_arrow/namespace.py:ArrowNamespace.sum",
"narwhals/_arrow/namespace.py:ArrowNamespace.mean",
"narwhals/_arrow/namespace.py:ArrowNamespace.median",
"narwhals/_arrow/names... | narwhals-dev/narwhals | 188ae9702b4d6398b146e2776fd5a73ec3d1ab79 | [Bug]: is_between incorrect behaviour (TypeError: cannot create expression literal for value of type Expr)
### Describe the bug
When attempting to use nw.lit to create literal expressions for filtering dates in a Narwhal DataFrame, the following error occurs:
`TypeError: cannot create expression literal for value o... | diff --git a/docs/how_it_works.md b/docs/how_it_works.md
index 70bc54bf..6a670358 100644
--- a/docs/how_it_works.md
+++ b/docs/how_it_works.md
@@ -266,7 +266,6 @@ In order to tell whether an aggregation is simple, Narwhals uses the private `_d
```python exec="1" result="python" session="pandas_impl" source="above"
pr... |
narwhals-dev__narwhals-1679 | [
{
"changes": {
"added_entities": null,
"added_modules": null,
"edited_entities": [
"narwhals/_arrow/dataframe.py:ArrowDataFrame.is_duplicated"
],
"edited_modules": [
"narwhals/_arrow/dataframe.py:ArrowDataFrame"
]
},
"file": "narwhals/_arrow/dataframe.... | narwhals-dev/narwhals | 0a67642a507699fecedcb5f945c2e05b5a0f4160 | bug: `is_duplicated` returns wrong number of elements for pyarrow
```python
import pandas as pd
import polars as pl
import pyarrow as pa
import narwhals as nw
df = pa.table({'a': [1, None, 1, None, 2, 3]})
print(nw.from_native(df).select(nw.col('a').is_duplicated()).to_native())
df = pl.DataFrame({'a': [1, Non... | diff --git a/narwhals/_arrow/dataframe.py b/narwhals/_arrow/dataframe.py
index 122ece9c..b51cba7c 100644
--- a/narwhals/_arrow/dataframe.py
+++ b/narwhals/_arrow/dataframe.py
@@ -602,10 +602,15 @@ class ArrowDataFrame(CompliantDataFrame, CompliantLazyFrame):
from narwhals._arrow.series import ArrowSeries
-... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.