internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: vega/altair

Issue:
Enable privacy-friendly web analytics for documentation
I'd be very curious to see how many users we have on our documentation and what the content is they typically view. It could guide future work on the docs. It seems to be quite easy to [enable for our PyData Sphinx theme](https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/analytics.html#analytics-and-usage-services). I'd suggest that we use [plausible.io](https://plausible.io/) as a tracking service as it is very privacy-friendly. It's also what other packages use such as pandas and [scikit-image](https://github.com/scikit-image/scikit-image/blob/main/doc/source/conf.py#L184). 

Plausible has a price tag, except if you self-host it. On the PyData Sphinx theme documentation, they mention that we might be able to get a self-hosted free server at scientific-python.org. I've reached out to them beginning of January via Discord but have not yet heard back.

I'd offer to pay for it myself for at least 3 months ([costs depend on traffic](https://plausible.io/#pricing)) so we get a good picture of what's happening. We can then decide how to continue in case we haven't heard back from the scientific-python.org maintainers.

Any thoughts? :)


Discussion:
I'm in favor! Thanks for researching how other projects are handling this.
I think it is good idea to collect insight how users are using the documentation. I cannot find it anymore, but I remember the website of vega is using google analytics to collect these insight. I would be a bit hesitant with self-paying with 21M downloads/month on pypi
Great idea! I'm in favor as long as it is a privacy-respective alternative like the one you suggested. Getting a self-hosted server via scientific-python.org sounds like the ideal solution, so hopefully you will hear back from them.
Heard back, we can use the service from scientific-python.org for free! :) I'll create a PR soon to configure the docs accordingly. Thank you all for the feedback.

Resolving patch:
diff --git a/doc/conf.py b/doc/conf.py
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -159,6 +159,10 @@
     ],
     "header_links_before_dropdown": 6,
     "announcement": """This website is for version 5. You can find the documentation for version 4 <a href='https://altair-viz.github.io/altair-viz-v4/'>here</a>.""",
+    "analytics": {
+        "plausible_analytics_domain": "altair-viz.github.io",
+        "plausible_analytics_url": ("https://views.scientific-python.org/js/script.js"),
+    },
 }
 
 html_context = {"default_mode": "light"}


Test patch:
Repository: vega/altair

Issue:
minimum pyarrow version enforced even if pandas is installed
The error we are facing in an environment says:
```python
RuntimeError: The pyarrow package must be version 11.0.0 or greater. Found version 6.0.1
```

And is caused by these lines:
https://github.com/altair-viz/altair/blob/main/altair/utils/core.py#L591-L592

```python
    # if data is specified and type is not, infer type from data
    if "type" not in attrs:
        if pyarrow_available() and data is not None and isinstance(data, DataFrameLike):
            ...

        elif isinstance(data, pd.DataFrame):
            # Fallback if pyarrow is not installed or if pandas is older than 1.5
```
In that particular environment pandas is installed by default and we are not able to upgrade pyarrow. 

Now the altair specifications errors as the code never tries the pandas approach as it has found a pyarrow version that is too old. 



Discussion:

Resolving patch:
diff --git a/altair/utils/_importers.py b/altair/utils/_importers.py
--- a/altair/utils/_importers.py
+++ b/altair/utils/_importers.py
@@ -93,5 +93,5 @@ def pyarrow_available() -> bool:
     try:
         import_pyarrow_interchange()
         return True
-    except ImportError:
+    except (ImportError, RuntimeError):
         return False


Test patch:
Repository: vega/altair

Issue:
Navbar in docs gets scrambled at a certain window width
### What happened?

This is low prio, but the docs navbar get a bit scrambled in "medium" screen width. It looks fine in wide screen:

![image](https://github.com/altair-viz/altair/assets/4560057/3e5943e9-75eb-4297-84fa-b61dacb2e6dd)
 
And narrow:

![image](https://github.com/altair-viz/altair/assets/4560057/e9adb554-7c58-421c-ba5c-8bcee8ecd010)

But there is an in-between for a few pixel that looks wonky, particularly for all the icons to the right:

![image](https://github.com/altair-viz/altair/assets/4560057/c848b2b0-888a-4d17-8065-a2f66d9c68e1)


### What would you like to happen instead?

I think we should snap to narrow earlier to avoid the scrambled appearance.

### Which version of Altair are you using?

_No response_


Discussion:
I didn't find any theme variable in https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/styling.html which we could use to do this. Maybe we'd need to adjust the `lg` bootstrap breakpoint? But I didn't manage to do this and not sure what side effects it has...

As an alternative, we could `"header_links_before_dropdown"` from 6 to 4 in `conf.py` so that the top bar looks like this:

<img width="1048" alt="image" src="https://github.com/vega/altair/assets/23366411/ef81334c-8ebc-4014-a3e3-e8e5fce271c1">

it solves the scrambled icons and makes it in general less crowded which is nice too. What do you think?
I like it! We could probably set a breakpoint in the CSS for screen sizes as you mentioned, but I prefer your solution with the dropdown to make the bar less crowded on all screen sizes.

Resolving patch:
diff --git a/doc/conf.py b/doc/conf.py
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -157,7 +157,7 @@
             "type": "fontawesome",
         },
     ],
-    "header_links_before_dropdown": 6,
+    "header_links_before_dropdown": 4,
     "announcement": """This website is for version 5. You can find the documentation for version 4 <a href='https://altair-viz.github.io/altair-viz-v4/'>here</a>.""",
     "analytics": {
         "plausible_analytics_domain": "altair-viz.github.io",


Test patch:
Repository: modin-project/modin

Issue:
access git revision from inside the project
`modin.__git_revision__` could return full git SHA of latest commit.
It is useful for developers to track which particular revision they are running at the moment.
Something like https://github.com/dask/dask/pull/1760


Discussion:
This would be great to add. If you are able and willing to contribute this, that would be great. Otherwise, I am happy to add this in the next couple of days.


Resolving patch:
diff --git a/modin/__init__.py b/modin/__init__.py
--- a/modin/__init__.py
+++ b/modin/__init__.py
@@ -1 +1,28 @@
+import os
+import subprocess
+
+
+def git_version():
+    def _execute_cmd_in_temp_env(cmd):
+        # construct environment
+        env = {}
+        for k in ['SYSTEMROOT', 'PATH', 'HOME']:
+            v = os.environ.get(k)
+            if v is not None:
+                env[k] = v
+        # LANGUAGE is used on win32
+        env['LANGUAGE'] = 'C'
+        env['LANG'] = 'C'
+        env['LC_ALL'] = 'C'
+        return subprocess.Popen(
+            cmd, stdout=subprocess.PIPE, env=env).communicate()[0]
+
+    try:
+        git_revision = _execute_cmd_in_temp_env(['git', 'rev-parse', 'HEAD'])
+        return git_revision.strip().decode('ascii')
+    except OSError:
+        return "Unknown"
+
+
+__git_revision__ = git_version()
 __version__ = "0.1.1"
diff --git a/modin/pandas/__init__.py b/modin/pandas/__init__.py
--- a/modin/pandas/__init__.py
+++ b/modin/pandas/__init__.py
@@ -13,6 +13,8 @@
 import os
 import ray
 
+from .. import __git_revision__, __version__
+
 try:
     if threading.current_thread().name == "MainThread":
         ray.init(
@@ -58,5 +60,5 @@ def get_npartitions():
     "Panel", "date_range", "Index", "MultiIndex", "Series", "bdate_range",
     "DatetimeIndex", "to_timedelta", "set_eng_float_format", "set_option",
     "CategoricalIndex", "Timedelta", "Timestamp", "NaT", "PeriodIndex",
-    "Categorical"
+    "Categorical", "__git_revision__", "__version__"
 ]


Test patch:
Repository: modin-project/modin

Issue:
Update Black formatting
### Describe the problem
<!-- Describe the problem clearly here. -->
During a recent pull request #88, we had a linting failure from black. We need to update the codebase with the most recent version of black.



Discussion:

Resolving patch:
diff --git a/modin/pandas/io.py b/modin/pandas/io.py
--- a/modin/pandas/io.py
+++ b/modin/pandas/io.py
@@ -18,7 +18,7 @@
 from ..data_management.partitioning.partition_collections import RayBlockPartitions
 from ..data_management.partitioning.remote_partition import RayRemotePartition
 from ..data_management.partitioning.axis_partition import (
-    split_result_of_axis_func_pandas
+    split_result_of_axis_func_pandas,
 )
 from ..data_management.data_manager import PandasDataManager
 


Test patch:
diff --git a/modin/pandas/test/test_dataframe.py b/modin/pandas/test/test_dataframe.py
--- a/modin/pandas/test/test_dataframe.py
+++ b/modin/pandas/test/test_dataframe.py
@@ -1705,7 +1705,7 @@ def test_fillna_sanity():
 @pytest.fixture
 def test_fillna_downcast():
     # infer int64 from float64
-    frame_data = {"a": [1., np.nan]}
+    frame_data = {"a": [1.0, np.nan]}
     df = pandas.DataFrame(frame_data)
     result = df.fillna(0, downcast="infer")
     ray_df = pd.DataFrame(frame_data).fillna(0, downcast="infer")
@@ -1813,7 +1813,7 @@ def test_fillna_dtype_conversion():
     ray_df = pd.DataFrame(index=range(3), columns=["A", "B"], dtype="float64")
     assert ray_df_equals_pandas(ray_df.fillna("nan"), df.fillna("nan"))
 
-    frame_data = {"A": [1, np.nan], "B": [1., 2.]}
+    frame_data = {"A": [1, np.nan], "B": [1.0, 2.0]}
     df = pandas.DataFrame(frame_data)
     ray_df = pd.DataFrame(frame_data)
     for v in ["", 1, np.nan, 1.0]:
@@ -3123,13 +3123,13 @@ def test_unstack():
 
 def test_update():
     df = pd.DataFrame(
-        [[1.5, np.nan, 3.], [1.5, np.nan, 3.], [1.5, np.nan, 3], [1.5, np.nan, 3]]
+        [[1.5, np.nan, 3.0], [1.5, np.nan, 3.0], [1.5, np.nan, 3], [1.5, np.nan, 3]]
     )
-    other = pd.DataFrame([[3.6, 2., np.nan], [np.nan, np.nan, 7]], index=[1, 3])
+    other = pd.DataFrame([[3.6, 2.0, np.nan], [np.nan, np.nan, 7]], index=[1, 3])
 
     df.update(other)
     expected = pd.DataFrame(
-        [[1.5, np.nan, 3], [3.6, 2, 3], [1.5, np.nan, 3], [1.5, np.nan, 7.]]
+        [[1.5, np.nan, 3], [3.6, 2, 3], [1.5, np.nan, 3], [1.5, np.nan, 7.0]]
     )
     assert ray_df_equals(df, expected)
Repository: modin-project/modin

Issue:
gitrevision errors
https://github.com/modin-project/modin/blob/cccea0bed17349727ba13376ee7cc62ac5619852/modin/__init__.py#L21

Current git revision tries to find the git commit by executing Popen directly from user process. This will start wherever user process start, which might not be a git repository. To fix it, we just need to run above line inside `modin.__file__` or something like that. 


Discussion:

Resolving patch:
diff --git a/modin/__init__.py b/modin/__init__.py
--- a/modin/__init__.py
+++ b/modin/__init__.py
@@ -2,7 +2,7 @@
 import subprocess
 
 
-def git_version():
+def _git_version():
     def _execute_cmd_in_temp_env(cmd):
         # construct environment
         env = {}
@@ -16,11 +16,15 @@ def _execute_cmd_in_temp_env(cmd):
         env["LC_ALL"] = "C"
         return subprocess.Popen(cmd, stdout=subprocess.PIPE, env=env).communicate()[0]
 
+    cwd = os.getcwd()
+    os.chdir(os.path.dirname(os.path.abspath(__file__)))
     try:
         git_revision = _execute_cmd_in_temp_env(["git", "rev-parse", "HEAD"])
-        return git_revision.strip().decode()
+        rev_string = git_revision.strip().decode()
     except OSError:
-        return "Unknown"
+        rev_string = "Unknown"
+    os.chdir(cwd)
+    return rev_string
 
 
 def get_execution_engine():
@@ -36,12 +40,12 @@ def get_partition_format():
     return "Pandas"
 
 
-__git_revision__ = git_version()
+__git_revision__ = _git_version()
 __version__ = "0.1.2"
 __execution_engine__ = get_execution_engine()
 __partition_format__ = get_partition_format()
 
 # We don't want these used outside of this file.
-del git_version
+del _git_version
 del get_execution_engine
 del get_partition_format


Test patch:
Repository: modin-project/modin

Issue:
describe can error after read_csv

### Describe the problem
<!-- Describe the problem clearly here. -->
`describe` gives an error after `read_csv` if not all columns are described.

### Source code / logs

```python
subprocess.call(['wget', 'https://s3.amazonaws.com/nyc-tlc/trip+data/green_tripdata_2017-01.csv',
                 '-O', '/tmp/green_tripdata_2017-01.csv'])
csv_data = pd.read_csv('/tmp/green_tripdata_2017-01.csv')
csv_data.describe()
```

<!-- Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached. Try to provide a reproducible test case that is the bare minimum necessary to generate the problem. -->



Discussion:

Resolving patch:
diff --git a/modin/data_management/data_manager.py b/modin/data_management/data_manager.py
--- a/modin/data_management/data_manager.py
+++ b/modin/data_management/data_manager.py
@@ -1295,22 +1295,24 @@ def describe(self, **kwargs):
         """
         # Only describe numeric if there are numeric
         # Otherwise, describe all
-        new_index = self.numeric_columns()
-        if len(new_index) != 0:
+        columns_for_describe = self.numeric_columns()
+        if len(columns_for_describe) != 0 and "object" in kwargs["exclude"]:
             numeric = True
         else:
             numeric = False
             # If no numeric dtypes, then do all
-            new_index = self.columns
+            columns_for_describe = self.columns
 
         def describe_builder(df, **kwargs):
             return pandas.DataFrame.describe(df, **kwargs)
 
         # Apply describe and update indices, columns, and dtypes
         func = self._prepare_method(describe_builder, **kwargs)
-        new_data = self.full_axis_reduce_along_select_indices(func, 0, new_index, False)
+        new_data = self.full_axis_reduce_along_select_indices(
+            func, 0, columns_for_describe, False
+        )
+        new_columns = columns_for_describe
         new_index = self.compute_index(0, new_data, False)
-        new_columns = self.compute_index(1, new_data, True)
         if numeric:
             new_dtypes = pandas.Series(
                 [np.float64 for _ in new_columns], index=new_columns
diff --git a/modin/pandas/io.py b/modin/pandas/io.py
--- a/modin/pandas/io.py
+++ b/modin/pandas/io.py
@@ -592,6 +592,7 @@ def _read_csv_with_offset_pandas_on_ray(fname, num_splits, start, end, kwargs, h
     to_read = header + bio.read(end - start)
     bio.close()
     pandas_df = pandas.read_csv(BytesIO(to_read), **kwargs)
+    pandas_df.columns = pandas.RangeIndex(len(pandas_df.columns))
     if kwargs.get("index_col", None) is not None:
         index = pandas_df.index
         # Partitions must have RangeIndex


Test patch:
Repository: modin-project/modin

Issue:
__repr__ after a transpose is slow
### Describe the problem
<!-- Describe the problem clearly here. -->
Previously, `transpose` was extremely slow and copied the entire dataset. Now we store some metadata and do the `transpose` at the same time as another operation.

It is instant to do `df.T`, but when you `repr(df.T)` it will trigger the `transpose`. We need to debug why it takes so long on the `repr`.

### Source code / logs
<!-- Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached. Try to provide a reproducible test case that is the bare minimum necessary to generate the problem. -->
```python
> %time x = df.T
> %time repr(x)
```



Discussion:

Resolving patch:
diff --git a/modin/data_management/data_manager.py b/modin/data_management/data_manager.py
--- a/modin/data_management/data_manager.py
+++ b/modin/data_management/data_manager.py
@@ -1814,18 +1814,21 @@ def front(self, n):
         Returns:
             DataManager containing the first n columns of the original DataManager.
         """
+        new_dtypes = (
+            self._dtype_cache if self._dtype_cache is None else self._dtype_cache[:n]
+        )
         # See head for an explanation of the transposed behavior
         if self._is_transposed:
             result = self.__constructor__(
                 self.data.transpose().take(0, n).transpose(),
                 self.index,
                 self.columns[:n],
-                self.dtypes[:n],
+                new_dtypes,
             )
             result._is_transposed = True
         else:
             result = self.__constructor__(
-                self.data.take(1, n), self.index, self.columns[:n], self.dtypes[:n]
+                self.data.take(1, n), self.index, self.columns[:n], new_dtypes
             )
         return result
 
@@ -1838,18 +1841,21 @@ def back(self, n):
         Returns:
             DataManager containing the last n columns of the original DataManager.
         """
+        new_dtypes = (
+            self._dtype_cache if self._dtype_cache is None else self._dtype_cache[-n:]
+        )
         # See head for an explanation of the transposed behavior
         if self._is_transposed:
             result = self.__constructor__(
                 self.data.transpose().take(0, -n).transpose(),
                 self.index,
                 self.columns[-n:],
-                self.dtypes[-n:],
+                new_dtypes,
             )
             result._is_transposed = True
         else:
             result = self.__constructor__(
-                self.data.take(1, -n), self.index, self.columns[-n:], self.dtypes[-n:]
+                self.data.take(1, -n), self.index, self.columns[-n:], new_dtypes
             )
         return result
 


Test patch:
Repository: modin-project/modin

Issue:
Fix empty series return value for numeric functions
### Describe the problem
Pandas 0.23.4 returns 
```
0   NaN
1   NaN
2   NaN
3   NaN
dtype: float64
```
only when it cannot calculate the mean, median, and other similar functions when `numeric_only=True` or `numeric_only=None` (if possible) and `axis=1`. If `axis=0`, then pandas returns a empty series of type `np.int64`.

### Source code / logs
```
import modin.pandas as pd
data = {
        "col1": [1, 'a', 3, 4],
        "col2": [4, 5, 6, 'd'],
        "col3": [8.0, 9.4, 'e', 11.3],
        "col4": ["a", "b", "c", "d"],
}
modin_df = pd.DataFrame(data)
modin_df.mean(axis = 'columns', skipna = False, numeric_only = None)
```



Discussion:

Resolving patch:
diff --git a/modin/data_management/data_manager.py b/modin/data_management/data_manager.py
--- a/modin/data_management/data_manager.py
+++ b/modin/data_management/data_manager.py
@@ -184,7 +184,7 @@ def numeric_function_clean_dataframe(self, axis):
         data_manager = self
         # If no numeric columns and over columns, then return empty Series
         if not axis and len(self.index) == 0:
-            result = pandas.Series(dtype=np.float64)
+            result = pandas.Series(dtype=np.int64)
 
         nonnumeric = [
             col
@@ -193,7 +193,8 @@ def numeric_function_clean_dataframe(self, axis):
         ]
         if len(nonnumeric) == len(self.columns):
             # If over rows and no numeric columns, return this
-            result = pandas.Series([np.NaN for _ in self.index])
+            if axis:
+                result = pandas.Series([np.nan for _ in self.index])
         else:
             data_manager = self.drop(columns=nonnumeric)
         return result, data_manager


Test patch:
Repository: modin-project/modin

Issue:
Full reduce functions return empty dataframe
### Describe the problem
Modin errors out when we try to return an empty dataframe with full reduce operations (operations that return a series such as `all`, `any`, `count`)

### Source code / logs
```
import modin.pandas as pd
data = {
        "col1": [1, 'a', 3, 4],
        "col2": [4, 5, 6, 'd'],
        "col3": [8.0, 9.4, 'e', 11.3],
        "col4": ["a", "b", "c", "d"],
}
modin_df = pd.DataFrame(data)
modin_df.count(numeric_only=True)
```



Discussion:

Resolving patch:
diff --git a/modin/data_management/data_manager.py b/modin/data_management/data_manager.py
--- a/modin/data_management/data_manager.py
+++ b/modin/data_management/data_manager.py
@@ -889,7 +889,9 @@ def full_reduce(self, axis, map_func, reduce_func=None, numeric_only=False):
         result = data_manager.data.full_reduce(
             map_func, reduce_func, axis ^ self._is_transposed
         )
-        if not axis:
+        if result.shape == (0,):
+            return result
+        elif not axis:
             result.index = data_manager.columns
         else:
             result.index = data_manager.index


Test patch:
Repository: modin-project/modin

Issue:
mean returns the wrong values
### Describe the problem
mean returns the wrong values 

### Source code / logs
```
import modin.pandas as pd
data = {
        "col1": [0, 1, 2, 3],
        "col2": [4, 5, 6, 7],
        "col3": [8, 9, 10, 11],
        "col4": [12, 13, 14, 15],
        "col5": [0, 0, 0, 0],
}
modin_df = pd.DataFrame(data)
modin_df.mean(axis=1)
```
We expect to get:
```
0    4.8
1    5.6
2    6.4
3    7.2
dtype: float64
```
but we get 
```
0    4.000000
1    4.666667
2    5.333333
3    6.000000
dtype: float64
```



Discussion:

Resolving patch:
diff --git a/modin/data_management/data_manager.py b/modin/data_management/data_manager.py
--- a/modin/data_management/data_manager.py
+++ b/modin/data_management/data_manager.py
@@ -927,8 +927,8 @@ def mean(self, **kwargs):
         """
         # Pandas default is 0 (though not mentioned in docs)
         axis = kwargs.get("axis", 0)
-        func = self._prepare_method(pandas.DataFrame.mean, **kwargs)
-        return self.full_reduce(axis, func, numeric_only=True)
+        kwargs["numeric_only"] = True
+        return self.sum(**kwargs).divide(self.count(axis=axis, numeric_only=True))
 
     def min(self, **kwargs):
         """Returns the minimum from each column or row.
diff --git a/modin/pandas/dataframe.py b/modin/pandas/dataframe.py
--- a/modin/pandas/dataframe.py
+++ b/modin/pandas/dataframe.py
@@ -2161,6 +2161,8 @@ def mean(self, axis=None, skipna=None, level=None, numeric_only=None, **kwargs):
             The mean of the DataFrame. (Pandas series)
         """
         axis = pandas.DataFrame()._get_axis_number(axis) if axis is not None else 0
+        if numeric_only is not None and not numeric_only:
+            self._validate_dtypes(numeric_only=True)
         return self._data_manager.mean(
             axis=axis, skipna=skipna, level=level, numeric_only=numeric_only, **kwargs
         )


Test patch:
Repository: modin-project/modin

Issue:
Diff returns wrong values when axis='rows'
### Describe the problem
Diff returns the wrong values when axis='rows'

### Source code / logs
```
import modin.pandas as pd
data = {
        "col1": [0, 1, 2, 3],
        "col2": [4, 5, 6, 7],
        "col3": [8, 9, 10, 11],
        "col4": [12, 13, 14, 15],
        "col5": [0, 0, 0, 0],
}
modin_df = pd.DataFrame(data)
modin_df.diff(axis='rows')
```
We expect to get:
```
	col1	col2	col3	col4	col5
0	NaN	NaN	NaN	NaN	NaN
1	1.0	1.0	1.0	1.0	0.0
2	1.0	1.0	1.0	1.0	0.0
3	1.0	1.0	1.0	1.0	0.0
```
But get:
```
	col1	col2	col3	col4	col5
0	NaN	NaN	NaN	NaN	NaN
1	NaN	NaN	NaN	NaN	NaN
2	NaN	NaN	NaN	NaN	NaN
3	NaN	NaN	NaN	NaN	NaN
```



Discussion:

Resolving patch:
diff --git a/modin/pandas/dataframe.py b/modin/pandas/dataframe.py
--- a/modin/pandas/dataframe.py
+++ b/modin/pandas/dataframe.py
@@ -1100,6 +1100,7 @@ def diff(self, periods=1, axis=0):
         Returns:
             DataFrame with the diff applied
         """
+        axis = pandas.DataFrame()._get_axis_number(axis)
         return DataFrame(
             data_manager=self._data_manager.diff(periods=periods, axis=axis)
         )


Test patch: