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

Issue:
Month dropdown on DateInput is very slow (~5s to appear)
# Summary

Month dropdown on DateInput is very slow (~5s to appear). See https://i.imgur.com/WkmHYag.gifv

# Steps to reproduce

What are the steps we should take to reproduce the bug:

1. Create `st.date_input('hi')`
2. Click on the date
3. Click on the month inside the date

## Expected behavior:

Month dropdown should appear almost instantly, with no user-perceived lag.

## Actual behavior:

Takes ~5 seconds

## Is this a regression?

Unsure. Does this date input dropdown use our virtualized selectbox?

# Debug info

- Streamlit version: develop
- Python version: 3.7.6
- Using Pipenv
- OS version: Windows 10
- Browser version: Chrome



Discussion:
Simple thing to do would be to change datetime.min to be today-10y by default.

Resolving patch:
diff --git a/lib/streamlit/elements/time_widgets.py b/lib/streamlit/elements/time_widgets.py
--- a/lib/streamlit/elements/time_widgets.py
+++ b/lib/streamlit/elements/time_widgets.py
@@ -61,12 +61,7 @@ def time_input(dg, label, value=None, key=None):
         return dg._enqueue("time_input", time_input_proto, current_value)  # type: ignore
 
     def date_input(
-        dg,
-        label,
-        value=None,
-        min_value=datetime.min,
-        max_value=None,
-        key=None,
+        dg, label, value=None, min_value=None, max_value=None, key=None,
     ):
         """Display a date input widget.
 
@@ -79,7 +74,7 @@ def date_input(
             0 to 2 date/datetime values is provided, the datepicker will allow
             users to provide a range. Defaults to today as a single-date picker.
         min_value : datetime.date or datetime.datetime
-            The minimum selectable date. Defaults to datetime.min.
+            The minimum selectable date. Defaults to today-10y.
         max_value : datetime.date or datetime.datetime
             The maximum selectable date. Defaults to today+10y.
         key : str
@@ -126,6 +121,9 @@ def date_input(
 
         if isinstance(min_value, datetime):
             min_value = min_value.date()
+        elif min_value is None:
+            today = date.today()
+            min_value = date(today.year - 10, today.month, today.day)
 
         date_input_proto.min = date.strftime(min_value, "%Y/%m/%d")
 


Test patch:
Repository: streamlit/streamlit

Issue:
When "streamlit run" file doesn't exit and has no extension, error printout is weird
1. Create a Python file and call it `example` (without .py)
2. `streamlit run example`

Here's what you get:
<img width="400px" src="https://user-images.githubusercontent.com/690814/95294472-307bcb00-082a-11eb-86b0-37c2a1335988.png" />

**This error message is not a valid sentence: "Streamlit requires raw Python (.py) files, not ."**

What's happening is that the code is trying to write the file extension in the error message, but in this case the file has no extension.

We should instead say something like "Streamlit requires raw Python (.py) files, and the provided file has no extension."




Discussion:
I can fix this problem. If approved, I will make a pull request.   
Thanks for volunteering @abhinand5, please feel free to take a shot at it and submit a PR.

Resolving patch:
diff --git a/lib/streamlit/cli.py b/lib/streamlit/cli.py
--- a/lib/streamlit/cli.py
+++ b/lib/streamlit/cli.py
@@ -204,10 +204,15 @@ def main_run(target, args=None, **kwargs):
 
     _, extension = os.path.splitext(target)
     if extension[1:] not in ACCEPTED_FILE_EXTENSIONS:
-        raise click.BadArgumentUsage(
-            "Streamlit requires raw Python (.py) files, not %s.\nFor more information, please see https://docs.streamlit.io"
-            % extension
-        )
+        if extension[1:] == "":
+            raise click.BadArgumentUsage(
+                "Streamlit requires raw Python (.py) files, but the provided file has no extension.\nFor more information, please see https://docs.streamlit.io"
+            )
+        else:    
+            raise click.BadArgumentUsage(
+                "Streamlit requires raw Python (.py) files, not %s.\nFor more information, please see https://docs.streamlit.io"
+                % extension
+            )
 
     if url(target):
         from streamlit.temporary_directory import TemporaryDirectory


Test patch:
Repository: streamlit/streamlit

Issue:
On the newest docs, "Deploy a Streamlit app" page is empty
**Link to doc page in question (if any):**

https://docs.streamlit.io/en/stable/deploy_streamlit_app.html

**What you think the docs should say:**

For now, show placeholder content (link to heroku deploy instructions?)
In the future, describe what to do for S4A.



Discussion:
Oops

Resolving patch:
diff --git a/lib/streamlit/elements/file_uploader.py b/lib/streamlit/elements/file_uploader.py
--- a/lib/streamlit/elements/file_uploader.py
+++ b/lib/streamlit/elements/file_uploader.py
@@ -43,6 +43,7 @@ def file_uploader(
             - If allow_multiple_files is True, returns a list with the
               uploaded files as UploadedFile objects. If no files were
               uploaded, returns an empty list.
+
             The UploadedFile class is a subclass of BytesIO, and therefore
             it is "file-like". This means you can pass them anywhere where
             a file is expected.


Test patch:
Repository: streamlit/streamlit

Issue:
Streamlit fails to start without Git executable
# Summary

Streamlit version `0.69.1` fails to start when run inside a Docker container that doesn't have Git installed.

# Steps to reproduce

1. Create a `Dockerfile` with the following contents:
```dockerfile
FROM python:3.8-slim
RUN pip install streamlit
CMD ["streamlit", "hello"]
```
2. Build the image:
```bash
docker build -t demo .
```
3. Run the app:
```bash
docker run -it --rm demo
```

## Expected behavior:

Streamlit starts without issues.

## Actual behavior:

Streamlit fails to start and displays the following error message:

```bash
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/git/__init__.py", line 83, in <module>
    refresh()
  File "/usr/local/lib/python3.8/site-packages/git/__init__.py", line 73, in refresh
    if not Git.refresh(path=path):
  File "/usr/local/lib/python3.8/site-packages/git/cmd.py", line 278, in refresh
    raise ImportError(err)
ImportError: Bad git executable.
The git executable must be specified in one of the following ways:
    - be included in your $PATH
    - be set via $GIT_PYTHON_GIT_EXECUTABLE
    - explicitly set via git.refresh()

All git commands will error until this is rectified.

This initial warning can be silenced or aggravated in the future by setting the
$GIT_PYTHON_REFRESH environment variable. Use one of the following values:
    - quiet|q|silence|s|none|n|0: for no warning or exception
    - warn|w|warning|1: for a printed warning
    - error|e|raise|r|2: for a raised exception

Example:
    export GIT_PYTHON_REFRESH=quiet
```

## Is this a regression?

**yes** (worked up until at least version `0.67.1`)

# Debug info

- Streamlit version: `0.69.1`
- Python version: `3.8.6`
- Using Conda? PipEnv? PyEnv? Pex? **NO**
- OS version: `4.19.76-linuxkit`

# Additional information

This bug can be worked around by setting `GIT_PYTHON_REFRESH=quiet` environment variable inside the Docker image.



Discussion:
+1 
This worked up until version `0.68.0`
Thanks for reporting, we're looking into making a patch for this.

Resolving patch:
diff --git a/lib/setup.py b/lib/setup.py
--- a/lib/setup.py
+++ b/lib/setup.py
@@ -8,7 +8,7 @@
 from pipenv.utils import convert_deps_to_pip
 from setuptools.command.install import install
 
-VERSION = "0.69.1"  # PEP-440
+VERSION = "0.69.2"  # PEP-440
 
 NAME = "streamlit"
 


Test patch:
Repository: streamlit/streamlit

Issue:
Improve  line_chart/bar_chart/area_chart API doc (index as X axis)
**Link to doc page in question (if any):**
https://streamlit.io/docs/api.html?highlight=line_chart#streamlit.line_chart
https://streamlit.io/docs/api.html?highlight=area_chart#streamlit.area_chart
https://streamlit.io/docs/api.html?highlight=bar_chart#streamlit.bar_chart

**Name of the Streamlit feature whose docs need improvement:**
Better explain index as the X axis, based on this issue: https://github.com/streamlit/streamlit/issues/385



Discussion:

Resolving patch:
diff --git a/lib/streamlit/elements/altair.py b/lib/streamlit/elements/altair.py
--- a/lib/streamlit/elements/altair.py
+++ b/lib/streamlit/elements/altair.py
@@ -34,6 +34,9 @@ def line_chart(dg, data=None, width=0, height=0, use_container_width=True):
         the chart's spec. As a result this is easier to use for many "just plot
         this" scenarios, while being less customizable.
 
+        If st.line_chart does not guess the data specification
+        correctly, try specifying your desired chart using st.altair_chart.
+
         Parameters
         ----------
         data : pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict
@@ -72,13 +75,16 @@ def line_chart(dg, data=None, width=0, height=0, use_container_width=True):
         return dg._enqueue("line_chart", vega_lite_chart_proto, last_index=last_index)  # type: ignore
 
     def area_chart(dg, data=None, width=0, height=0, use_container_width=True):
-        """Display a area chart.
+        """Display an area chart.
 
         This is just syntax-sugar around st.altair_chart. The main difference
         is this command uses the data's own column and indices to figure out
         the chart's spec. As a result this is easier to use for many "just plot
         this" scenarios, while being less customizable.
 
+        If st.area_chart does not guess the data specification
+        correctly, try specifying your desired chart using st.altair_chart.
+
         Parameters
         ----------
         data : pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, or dict
@@ -123,6 +129,9 @@ def bar_chart(dg, data=None, width=0, height=0, use_container_width=True):
         the chart's spec. As a result this is easier to use for many "just plot
         this" scenarios, while being less customizable.
 
+        If st.bar_chart does not guess the data specification
+        correctly, try specifying your desired chart using st.altair_chart.
+
         Parameters
         ----------
         data : pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, or dict


Test patch:
Repository: streamlit/streamlit

Issue:
Move boto3 and botocore into dev-packages
These two are only used for Static Embedded Apps, but the majority of our users never use that feature. We should be able to migrate them into DevDependencies and cut down on the "libraries required when you `pip install streamlit`"


Discussion:
Agreed
Another reason would be to reassure privacy-conscious users we're not copying all their data.

Audience question at Streamlit open source launch: "Why is boto3 a dependency?" https://youtu.be/0It8phQ1gkQ?t=1113
Adrien: "We should probably get rid of that dependency" xD

Resolving patch:
diff --git a/lib/streamlit/config.py b/lib/streamlit/config.py
--- a/lib/streamlit/config.py
+++ b/lib/streamlit/config.py
@@ -157,11 +157,9 @@ def _section_memoized_option_name():
         replaced_by=replaced_by,
         type_=type_,
     )
-    assert (
-        option.section in _section_descriptions
-    ), 'Section "%s" must be one of %s.' % (
-        option.section,
-        ", ".join(_section_descriptions.keys()),
+    assert option.section in _section_descriptions, (
+        'Section "%s" must be one of %s.'
+        % (option.section, ", ".join(_section_descriptions.keys()),)
     )
     assert key not in _config_options, 'Cannot define option "%s" twice.' % key
     _config_options[key] = option
@@ -199,6 +197,7 @@ def _delete_option(key):
 
 _create_option(
     "global.sharingMode",
+    visibility="hidden",
     description="""
         Configure the ability to share apps to the cloud.
 


Test patch:
Repository: streamlit/streamlit

Issue:
Request for tar file for lib in pypi.
_(Note, you don't have to fill out every section here. They're just here for guidance. That said, nicely detailed feature requests are more likely to get eng attention sooner)_

### Problem

As of now for streamlit , we have only wheels file in pypi. Can the streamlit team add tar file as well. 

https://pypi.org/project/streamlit/#files 

### Solution

Create a sdist ( tar ) of the package and make it avaliable in pypi
https://realpython.com/pypi-publish-python-package/ 

### Additional context

Add any other context or screenshots about the feature request here. For example, did this FR come from https://discuss.streamlit.io or another site? Link the original source here!



Discussion:
Hi @jacoblukose - 

Thanks for stopping by. What is your use case for wanting the source distribution vs. a wheel? Is this something where you could use the [tags](https://github.com/streamlit/streamlit/tags) that we're already publishing?

Best,
Randy
The place I work at, basically has a pipeline to pull libraries from pypi, but the pipeline requires sdist to be published for security purposes. I really want to try out streamlit, but the unavailabilty of not having sdist is blocking me :( 
Good enough reason for me :)
Thankyou. Can we keep the issue open until we have `sdist` published ? 
Sure, this issue is still open, nothing has changed
sounds good. Thanks for the quick response :D 
@randyzwitch will you be able to provide a rough timeline on when this can be pushed out :) 
I don't, as I don't manage our developer sprints. But looking at our makefile, it looks like we used to do this, so I'll see if I can twist some arms :)

https://github.com/streamlit/streamlit/blob/develop/Makefile#L166
@randyzwitch  thankyou! 

Resolving patch:
diff --git a/lib/setup.py b/lib/setup.py
--- a/lib/setup.py
+++ b/lib/setup.py
@@ -4,10 +4,17 @@
 import subprocess
 import sys
 
-from pipenv.project import Project
-from pipenv.utils import convert_deps_to_pip
 from setuptools.command.install import install
 
+try:
+    from pipenv.project import Project
+    from pipenv.utils import convert_deps_to_pip
+except:
+    exit_msg = (
+        "pipenv is required to package Streamlit. Please install pipenv and try again"
+    )
+    sys.exit(exit_msg)
+
 VERSION = "0.69.2"  # PEP-440
 
 NAME = "streamlit"


Test patch:
diff --git a/lib/tests/streamlit/report_test.py b/lib/tests/streamlit/report_test.py
--- a/lib/tests/streamlit/report_test.py
+++ b/lib/tests/streamlit/report_test.py
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-"""Unit tests for Report.py."""
+"""Unit tests for report.py."""
 
 from unittest.mock import patch
 import copy
Repository: streamlit/streamlit

Issue:
Bad sortColumnIdx error after a dataframe is changed
# Summary

When a dataframe is loaded, sorted on a column at the end, and then the number of columns is reduced, a "Bad sortColumnIdx" error is thrown.

# Steps to reproduce

Minimal, Reproducible Example:
```
import numpy as np
import pandas as pd
import streamlit as st

n = st.sidebar.number_input('Number of columns', value=5)
df = pd.DataFrame(np.random.randint(0, 10, size=(10, n)))
st.dataframe(df)
```

1. Run the app
2. Sort the dataframe on the last column
3. Reduce the number of columns

## Expected behavior:

The dataframe should revert to unsorted or be sorted by its last column.

## Actual behavior:

The dataframe is not displayed and a Bad sortColumnIdx error is shown.

## Is this a regression?

No

# Debug info

- Streamlit version: 0.56.0
- Python version: 3.8.1
- Conda environment
- OS version: macOS 10.14.6
- Browser version: Firefox 72.0.1, Chrome 79.0.3945.130

Bad sortColumnIdx error after a dataframe is changed
# Summary

When a dataframe is loaded, sorted on a column at the end, and then the number of columns is reduced, a "Bad sortColumnIdx" error is thrown.

# Steps to reproduce

Minimal, Reproducible Example:
```
import numpy as np
import pandas as pd
import streamlit as st

n = st.sidebar.number_input('Number of columns', value=5)
df = pd.DataFrame(np.random.randint(0, 10, size=(10, n)))
st.dataframe(df)
```

1. Run the app
2. Sort the dataframe on the last column
3. Reduce the number of columns

## Expected behavior:

The dataframe should revert to unsorted or be sorted by its last column.

## Actual behavior:

The dataframe is not displayed and a Bad sortColumnIdx error is shown.

## Is this a regression?

No

# Debug info

- Streamlit version: 0.56.0
- Python version: 3.8.1
- Conda environment
- OS version: macOS 10.14.6
- Browser version: Firefox 72.0.1, Chrome 79.0.3945.130



Discussion:
Thanks @erik-hasse! We're currently overhauling our dataframe logic (see https://github.com/streamlit/streamlit/pull/1021), which will hopefully fix this. 

I've moved this bug to our internal triage board, and we'll take another look at it after the above PR lands.
Thanks @erik-hasse! We're currently overhauling our dataframe logic (see https://github.com/streamlit/streamlit/pull/1021), which will hopefully fix this. 

I've moved this bug to our internal triage board, and we'll take another look at it after the above PR lands.

Resolving patch:
diff --git a/e2e/scripts/st_dataframe_sort_column.py b/e2e/scripts/st_dataframe_sort_column.py
new file mode 100644
--- /dev/null
+++ b/e2e/scripts/st_dataframe_sort_column.py
@@ -0,0 +1,7 @@
+import numpy as np
+import pandas as pd
+import streamlit as st
+
+cols = st.number_input("Number of columns", value=5)
+df = pd.DataFrame(np.random.randint(0, 10, size=(10, cols)))
+st.dataframe(df)


Test patch:
Repository: streamlit/streamlit

Issue:
Update imports of S3Storage now that boto3 is a dev dependency
Regression from boto3 dependency change

![image](https://user-images.githubusercontent.com/24946400/99606051-f4b25480-29d6-11eb-92ec-d69a842d2bd8.png)



Discussion:

Resolving patch:
diff --git a/lib/streamlit/config.py b/lib/streamlit/config.py
--- a/lib/streamlit/config.py
+++ b/lib/streamlit/config.py
@@ -451,7 +451,7 @@ def _server_headless():
     )
 
 
-@_create_option("server.liveSave", type_=bool)
+@_create_option("server.liveSave", type_=bool, visibility="hidden")
 def _server_live_save():
     """Immediately share the app in such a way that enables live
     monitoring, and post-run analysis.
diff --git a/lib/streamlit/report_session.py b/lib/streamlit/report_session.py
--- a/lib/streamlit/report_session.py
+++ b/lib/streamlit/report_session.py
@@ -38,7 +38,6 @@
 from streamlit.proto.ClientState_pb2 import ClientState
 from streamlit.server.server_util import serialize_forward_msg
 from streamlit.storage.file_storage import FileStorage
-from streamlit.storage.s3_storage import S3Storage
 from streamlit.watcher.local_sources_watcher import LocalSourcesWatcher
 import streamlit.elements.exception_proto as exception_proto
 
@@ -616,6 +615,8 @@ def _get_storage(self):
         if self._storage is None:
             sharing_mode = config.get_option("global.sharingMode")
             if sharing_mode == "s3":
+                from streamlit.storage.s3_storage import S3Storage
+
                 self._storage = S3Storage()
             elif sharing_mode == "file":
                 self._storage = FileStorage()


Test patch:
Repository: streamlit/streamlit

Issue:
st.number_input doesn't accept reasonable int arguments
# Summary

Using `st.number_input` in a very reasonable way:

```python
x = st.number_input("x", 0, 10)
```

causes an exception to be thrown

```
StreamlitAPIException: All arguments must be of the same type. value has float type. min_value has int type. max_value has int type.

Traceback:
    x = st.number_input("x", 0, 10)
```

## Expected behavior:

This should "just work," in the sense that it should create a number input that accepts `int`s between 0 and 10, with an initial default value of 0.

## Actual behavior:

You get the exception above. You can "trick" Streamlit into providing the right behavior by forcing the `value` parameter to have type `int` as follows:

```python
x = st.number_input("x", 0, 10, 0)
```

But I think this should just work without that extra parameter.

## Is this a regression?

??

# Debug info

- Streamlit version: `Streamlit, version 0.73.0`
- Python version: `Python 3.8.5`
- Python environment: `pipenv, version 2020.11.4`
- OS version: `Ubuntu 20.04.1 LTS`




Discussion:
Thanks @treuille , that looks like behaviour we can definitely improve.

Resolving patch:
diff --git a/lib/streamlit/elements/number_input.py b/lib/streamlit/elements/number_input.py
--- a/lib/streamlit/elements/number_input.py
+++ b/lib/streamlit/elements/number_input.py
@@ -75,7 +75,7 @@ def number_input(
         """
 
         if isinstance(value, NoValue):
-            if min_value:
+            if min_value is not None:
                 value = min_value
             else:
                 value = 0.0  # We set a float as default


Test patch:
diff --git a/lib/tests/streamlit/number_input_test.py b/lib/tests/streamlit/number_input_test.py
--- a/lib/tests/streamlit/number_input_test.py
+++ b/lib/tests/streamlit/number_input_test.py
@@ -35,6 +35,11 @@ def test_data_type(self):
         st.number_input("Label", value=0.5)
         c = self.get_delta_from_queue().new_element.number_input
         self.assertEqual(NumberInput.FLOAT, c.data_type)
+        
+    def test_min_value_zero_sets_default_value(self):
+        st.number_input("Label", 0, 10)
+        c = self.get_delta_from_queue().new_element.number_input
+        self.assertEqual(c.default, 0)  # the 0 we provided, not 0.0!
 
     def test_just_label(self):
         """Test that it can be called with no value."""
Repository: streamlit/streamlit

Issue:
Ensure file uploader works with st.image and st.video
When developing, noticed that an exception had to be made with UploadedFile in media proto but during PR review testing, this didnt seem to throw an issue. However, testing it now throws an error. To be safe, make sure anywhere we're taking a BytesIO also takes in the returned object. https://github.com/streamlit/streamlit/pull/2013#discussion_r500539640


Discussion:

Resolving patch:
diff --git a/lib/streamlit/elements/image_proto.py b/lib/streamlit/elements/image_proto.py
--- a/lib/streamlit/elements/image_proto.py
+++ b/lib/streamlit/elements/image_proto.py
@@ -276,7 +276,7 @@ def image_to_url(
     # BytesIO
     # Note: This doesn't support SVG. We could convert to png (cairosvg.svg2png)
     # or just decode BytesIO to string and handle that way.
-    elif type(image) is io.BytesIO:
+    elif isinstance(image, io.BytesIO):
         data = _BytesIO_to_bytes(image)
 
     # Numpy Arrays (ie opencv)


Test patch: