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

Issue:
 experimental_get_query_params  won't work before rerun 
### Checklist

- [X] I have searched the [existing issues](https://github.com/streamlit/streamlit/issues) for similar issues.
- [X] I added a very descriptive title to this issue.
- [X] I have provided sufficient information below to help reproduce this issue.

### Summary

User can not get right query_params before rerun.

### Reproducible Code Example

```Python
import streamlit as st

st.experimental_set_query_params(param=3)
st.write(st.experimental_get_query_params())
```


### Steps To Reproduce

Run script, `{"param ": 3}` will not appear at first time until rerun script after querystring in browser already changed.

### Expected Behavior

Show `{"param ": 3}`

### Current Behavior

show empty dict

### Is this a regression?

- [X] Yes, this used to work in a previous version.

### Debug info

- Streamlit version: 1.20.0
- Python version: 3.10.6
- Operating System: Linux
- Browser: Chrome
- Virtual environment: None


### Additional Information

In previous version `set_query_params` will set `ctx.query_string = parse.urlencode(query_params, doseq=True)` immediately.

But in 1.20, this line is removed while `get_query_params` still get if from `ctx.query_string` .

### Are you willing to submit a PR?

- [x] Yes, I am willing to submit a PR!


Discussion:

Resolving patch:
diff --git a/lib/streamlit/commands/query_params.py b/lib/streamlit/commands/query_params.py
--- a/lib/streamlit/commands/query_params.py
+++ b/lib/streamlit/commands/query_params.py
@@ -97,6 +97,7 @@ def set_query_params(**query_params: Any) -> None:
     msg.page_info_changed.query_string = _ensure_no_embed_params(
         query_params, ctx.query_string
     )
+    ctx.query_string = msg.page_info_changed.query_string
     ctx.enqueue(msg)
 
 


Test patch:
diff --git a/lib/tests/streamlit/streamlit_test.py b/lib/tests/streamlit/streamlit_test.py
--- a/lib/tests/streamlit/streamlit_test.py
+++ b/lib/tests/streamlit/streamlit_test.py
@@ -693,6 +693,13 @@ def test_set_query_params_exceptions(self):
         with self.assertRaises(StreamlitAPIException):
             st.experimental_set_query_params(embed_options="show_colored_line")
 
+    def test_get_query_params_after_set_query_params(self):
+        """Test valid st.set_query_params sends protobuf message."""
+        p_set = dict(x=["a"])
+        st.experimental_set_query_params(**p_set)
+        p_get = st.experimental_get_query_params()
+        self.assertEqual(p_get, p_set)
+
     @parameterized.expand([(st.error,), (st.warning,), (st.info,), (st.success,)])
     def test_st_alert_exceptions(self, alert_func):
         """Test that alert functions throw an exception when a non-emoji is given as an icon."""
Repository: streamlit/streamlit

Issue:
pandas 2.0 support
### Checklist

- [X] I have searched the [existing issues](https://github.com/streamlit/streamlit/issues) for similar issues.
- [X] I added a very descriptive title to this issue.
- [X] I have provided sufficient information below to help reproduce this issue.

### Summary

```
The conflict is caused by:
    The user requested pandas==2.0.0
    streamlit 1.20.0 depends on pandas<2 and >=0.25
```

### Reproducible Code Example

```Python
pip install pandas==2.0.0
pip install streamlit==1.20.0
```


### Steps To Reproduce

_No response_

### Expected Behavior

_No response_

### Current Behavior

_No response_

### Is this a regression?

- [ ] Yes, this used to work in a previous version.

### Debug info

- Streamlit version: 1.20.0
- Python version: 3.11.1
- Operating System:
- Browser:
- Virtual environment:


### Additional Information

the following line should be updated
[https://github.com/streamlit/streamlit/blob/11950acfa537475109b421fea6da43c9d410542c/lib/setup.py#L40](url)

### Are you willing to submit a PR?

- [ ] Yes, I am willing to submit a PR!


Discussion:
Related: https://github.com/streamlit/streamlit/pull/6378

Can you check if this issue still occurs in the nightly release?
https://docs.streamlit.io/library/advanced-features/prerelease#nightly-releases
> Related: #6378
> 
> Can you check if this issue still occurs in the nightly release? https://docs.streamlit.io/library/advanced-features/prerelease#nightly-releases

Yup that worked!! This comment suggests the pin is should to be removed once pandas 2.0 is widely released which it now is. https://github.com/streamlit/streamlit/pull/6378#issuecomment-1487467288
@seanabreau  should this issue be re-opened, as streamlit is still pinned to pandas <2 on the `develop` branch?
yes, the nightly version works but was disappointed not to see 2.0 supported in the release last week

Resolving patch:
diff --git a/lib/setup.py b/lib/setup.py
--- a/lib/setup.py
+++ b/lib/setup.py
@@ -37,7 +37,7 @@
     "importlib-metadata>=1.4",
     "numpy",
     "packaging>=14.1",
-    "pandas<2,>=0.25",
+    "pandas<3,>=0.25",
     "pillow>=6.2.0",
     "protobuf<4,>=3.12",
     "pyarrow>=4.0",


Test patch:
diff --git a/lib/tests/streamlit/elements/data_editor_test.py b/lib/tests/streamlit/elements/data_editor_test.py
--- a/lib/tests/streamlit/elements/data_editor_test.py
+++ b/lib/tests/streamlit/elements/data_editor_test.py
@@ -420,7 +420,7 @@ def test_with_supported_index(self, index: pd.Index):
         self.assertIsInstance(return_df, pd.DataFrame)
 
     @unittest.skipIf(
-        is_pandas_version_less_than("2.0.0rc1") is False,
+        is_pandas_version_less_than("2.0.0") is False,
         "This test only runs if pandas is < 2.0.0",
     )
     def test_with_old_supported_index(self):
Repository: streamlit/streamlit

Issue:
st.json replaces multiple spaces with single space
### Checklist

- [X] I have searched the [existing issues](https://github.com/streamlit/streamlit/issues) for similar issues.
- [X] I added a very descriptive title to this issue.
- [X] I have provided sufficient information below to help reproduce this issue.

### Summary

When using st.json, multiple spaces in strings are replaced with a single space.

### Reproducible Code Example

```Python
import streamlit as st

st.json({"Hello     World": "Hello    James"})
```


### Steps To Reproduce

_No response_

### Expected Behavior

_No response_

### Current Behavior

_No response_

### Is this a regression?

- [ ] Yes, this used to work in a previous version.

### Debug info

- Streamlit version:
- Python version:
- Operating System:
- Browser:
- Virtual environment:


### Additional Information

_No response_

### Are you willing to submit a PR?

- [ ] Yes, I am willing to submit a PR!
st.json replaces multiple spaces with single space
### Checklist

- [X] I have searched the [existing issues](https://github.com/streamlit/streamlit/issues) for similar issues.
- [X] I added a very descriptive title to this issue.
- [X] I have provided sufficient information below to help reproduce this issue.

### Summary

When using st.json, multiple spaces in strings are replaced with a single space.

### Reproducible Code Example

```Python
import streamlit as st

st.json({"Hello     World": "Hello    James"})
```


### Steps To Reproduce

_No response_

### Expected Behavior

_No response_

### Current Behavior

_No response_

### Is this a regression?

- [ ] Yes, this used to work in a previous version.

### Debug info

- Streamlit version:
- Python version:
- Operating System:
- Browser:
- Virtual environment:


### Additional Information

_No response_

### Are you willing to submit a PR?

- [ ] Yes, I am willing to submit a PR!


Discussion:

Resolving patch:
diff --git a/e2e/scripts/st_json.py b/e2e/scripts/st_json.py
--- a/e2e/scripts/st_json.py
+++ b/e2e/scripts/st_json.py
@@ -17,3 +17,5 @@
 data = {"foo": "bar"}
 st.json(data)
 st.json(data, expanded=False)
+data = {"Hello     World": "Foo    Bar"}
+st.json(data)


Test patch:
Repository: streamlit/streamlit

Issue:
Should st.experimental_user.email local value be test@example.com?
### Checklist

- [X] I have searched the [existing issues](https://github.com/streamlit/streamlit/issues) for similar issues.
- [X] I added a very descriptive title to this issue.
- [X] I have provided sufficient information below to help reproduce this issue.

### Summary

Currently st.experimental_user.email returns `test@localhost.com` when run locally (cite [docs](https://docs.streamlit.io/library/api-reference/personalization/st.experimental_user#local-development)).

However, a more standard and correct approach is to use `example.com` domain ([cite](https://en.wikipedia.org/wiki/Example.com)) which is safer.

Should we switch?

### Reproducible Code Example

```Python
import streamlit as st

st.write(st.experimental_user.email)
```


### Steps To Reproduce

1. Run the code example in a local environment

### Expected Behavior

I see `test@example.com` which is standard

### Current Behavior

I see `test@localhost.com`, which might not be totally safe and isn't a standard approach.

### Is this a regression?

- [ ] Yes, this used to work in a previous version.

### Debug info

- Streamlit version: 1.25
- Python version: 3.11
- Operating System: MacOS
- Browser: Chrome


### Additional Information

Thanks @jroes for finding this!


Discussion:
**If this issue affects you, please react with a 👍 (thumbs up emoji) to the initial post.**

Your feedback helps us prioritize which bugs to investigate and address first.

![Visits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Fstreamlit%2Fstreamlit%2Fissues%2F7215&title=visits&edge_flat=false)


Resolving patch:
diff --git a/lib/streamlit/web/server/browser_websocket_handler.py b/lib/streamlit/web/server/browser_websocket_handler.py
--- a/lib/streamlit/web/server/browser_websocket_handler.py
+++ b/lib/streamlit/web/server/browser_websocket_handler.py
@@ -96,7 +96,7 @@ def open(self, *args, **kwargs) -> Optional[Awaitable[None]]:
             email = user_obj["email"]
             is_public_cloud_app = user_obj["isPublicCloudApp"]
         except (KeyError, binascii.Error, json.decoder.JSONDecodeError):
-            email = "test@localhost.com"
+            email = "test@example.com"
 
         user_info: Dict[str, Optional[str]] = dict()
         if is_public_cloud_app:


Test patch:
Repository: streamlit/streamlit

Issue:
Changing start_time of st.video() doesn't work for the same video
### Checklist

- [X] I have searched the [existing issues](https://github.com/streamlit/streamlit/issues) for similar issues.
- [X] I added a very descriptive title to this issue.
- [X] I have provided sufficient information below to help reproduce this issue.

### Summary

Changing start_time of st.video() doesn't work for the same video.

### Reproducible Code Example

```Python
import streamlit as st

timestamp = st.text_input('timestamp', '6')
st.video('local video path', start_time=int(timestamp))
```


### Steps To Reproduce

1. Replace 'local video path' with your own video path in the provided code, and run the code
2. Type different timestamp in the text input box
3. The video timestamp doesn't change

### Expected Behavior

The timestamp should change as start_time changes.

### Current Behavior

The video timestamp doesn't change. It always shows the initial timestamp. However, if you change the video to a different one in the source code and rerun the app, the timestamp will change correctly.

### Is this a regression?

- [ ] Yes, this used to work in a previous version.

### Debug info

- Streamlit version: 1.25.0
- Python version: Python 3.10.11
- Operating System: Windows 11 Home 22H2
- Browser: Microsoft Edge Version 115.0.1901.188 (Official build) (64-bit)


### Additional Information

_No response_


Discussion:
Thank you @jpswing for reporting this issue. 

I was able to reproduce it and can confirm that this is a bug. 
here is a temporary fix
```

with st.empty():
   st.video('local video path', start_time=int(timestamp))
```

Resolving patch:
diff --git a/e2e/scripts/st_video.py b/e2e/scripts/st_video.py
--- a/e2e/scripts/st_video.py
+++ b/e2e/scripts/st_video.py
@@ -19,3 +19,7 @@
 url = "https://www.w3schools.com/html/mov_bbb.mp4"
 file = requests.get(url).content
 st.video(file)
+
+# Test start time with widget
+timestamp = st.number_input("Start Time (in seconds)", min_value=0, value=6)
+st.video(url, start_time=int(timestamp))


Test patch:
Repository: streamlit/streamlit

Issue:
A header with Japanese text has no anchor link.
### Summary

I found that a header with Japanese text has no anchor link.

### Steps to reproduce

Code snippet:

```
import streamlit as st
st.header("セクション")
```

1. Run code snippet above.
2. Check if the header has anchor link or not.

**Expected behavior:**

The header ("セクション") has anchor link.

**Actual behavior:**

The header ("セクション") has no anchor link.

### Is this a regression?

No

### Debug info

- Streamlit version: Streamlit, version 1.10.0
- Python version: Python 3.8.10
- Using Conda
- OS version: Ubuntu 20.04.4 LTS
- Browser version: Chrome / Version 104.0.5112.101 (Official Build) (x86_64)

### Additional information

A header with Korean text or Chinese text also has no anchor link.



Discussion:
Leaving this for reference: https://github.com/microsoft/vscode/issues/20626 

It looks like from a quick search, it might be possible to deal with these characters through a replacement of invalid characters. 

Resolving patch:
diff --git a/e2e/scripts/st_title.py b/e2e/scripts/st_title.py
--- a/e2e/scripts/st_title.py
+++ b/e2e/scripts/st_title.py
@@ -16,3 +16,6 @@
 
 st.title("This title is awesome!")
 st.title("This title is awesome too!", anchor="awesome-title")
+
+st.title("日本語タイトル")
+st.title("その他の邦題", anchor="アンカー")


Test patch:
Repository: RocketMap/RocketMap

Issue:
Showing spawn points breaks map display
## Expected Behavior

Showing spawn points should work
## Current Behavior

Using a MySQL database, turning on spawn points doesn't work and stops the map display from updating.

I get the following error in the output:

```
2016-08-13T13:45:14.644151916Z app[web.1]:   File "/app/.scalingo/python/lib/python2.7/site-packages/pymysql/err.py", line 120, in raise_mysql_exception
2016-08-13T13:45:14.644158031Z app[web.1]:     _check_mysql_exception(errinfo)
2016-08-13T13:45:14.644163330Z app[web.1]:   File "/app/.scalingo/python/lib/pyt
hon2.7/site-packages/pymysql/err.py", line 115, in _check_mysql_exception
2016-08-13T13:45:14.644169244Z app[web.1]:     raise InternalError(errno, errorv
alue)
2016-08-13T13:45:14.644175329Z app[web.1]: InternalError: (1055, u"Expression #1
 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'pog
omap.t1.latitude' which is not functionally dependent on columns in GROUP BY cla
use; this is incompatible with sql_mode=only_full_group_by")
```
## Steps to Reproduce (for bugs)
1. Use a MySQL database
2. Turn on spawn point display
## Context

Can't view spawn points.
## Your Environment
- Version used: f56f3f42
- Operating System and version (desktop or mobile): Ubuntu 16.04.1



Discussion:
Now, I understand this could be resolved by disabling only_full_group_by, but is there any way to make the query work with the default MySQL settings?

this problem with sql_mod only_full_group_by.
only_full_group_by enabled in MySQL >= 5.7

Would using a distinct query here instead work better?


Resolving patch:
diff --git a/pogom/models.py b/pogom/models.py
--- a/pogom/models.py
+++ b/pogom/models.py
@@ -200,9 +200,13 @@ def get_spawnpoints(cls, swLat, swLng, neLat, neLng):
                             )
                      )
 
-        query = query.group_by(Pokemon.spawnpoint_id).dicts()
+        # Sqlite doesn't support distinct on columns
+        if args.db_type == 'mysql':
+            query = query.distinct(Pokemon.spawnpoint_id)
+        else:
+            query = query.group_by(Pokemon.spawnpoint_id)
 
-        return list(query)
+        return list(query.dicts())
 
 
 class Pokestop(BaseModel):


Test patch:
Repository: RocketMap/RocketMap

Issue:
Captcha count on status page not updated when using -w parameter
<!--- Provide a general summary of the issue in the Title above -->

## Expected Behavior

When an account gets captcha'd, the captcha count on the status page is supposed to increase by 1

## Current Behavior

- When an account gets captcha'd while using the -w parameter, the status page will not update the captcha count for this account:

```
2017-01-24 17:33:23,136 [ search-worker-2][        search][    INFO] Scanning step 2 for a spawn.
2017-01-24 17:33:24,327 [ search-worker-2][        search][    INFO] Account 4ixxxxxxxxxxxxxx has encountered a captcha, putting away account for now.
2017-01-24 17:33:24,328 [ search-worker-2][        search][    INFO] Waiting to get new account from the queue...
2017-01-24 17:33:24,377 [ search-worker-2][        search][    INFO] Switching to account <xyz>
2017-01-24 17:33:38,593 [account-recycler][        search][    INFO] Account recycler running. Checking status of 1 accounts.
2017-01-24 17:33:38,593 [account-recycler][        search][    INFO] Account 4ixxxxxxxxxxxxxx needs to cool off for 119.0 minutes due to captcha found.
```
![no_captcha](https://cloud.githubusercontent.com/assets/20759246/22257368/1ed77ad4-e25e-11e6-8732-5d82d3932f76.png)


- When I do the same scan without the -w parameter the captcha count is updated correctly:
![captcha](https://cloud.githubusercontent.com/assets/20759246/22257412/4a5bc44e-e25e-11e6-829f-604c7907e98a.png)

## Possible Solution
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
<!--- or ideas how to implement the addition or change -->

## Steps to Reproduce (for bugs)
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
<!--- reproduce this bug. Include code to reproduce, if relevant -->
1. Run a scan with the -w parameter 
2. Wait for a captcha
3. Check the captcha count on the status page

## Context
I solve captchas manually and use the captcha count on the status page to see which accounts are captcha'd. Without the captcha count I need to look at the 'Last Modified' column to figure out which accounts are currently put on hold due to captchas.

## Your Environment
<!--- Include as many relevant details about the environment you experienced the bug in -->
* Version used: up-to-date except for latest commit #1746
* Environment name and version (e.g. Python 2.7): Python 2.7.12
* parameters used:  -ns -speed -gi -w 4 -st 6



Discussion:

Resolving patch:
diff --git a/pogom/search.py b/pogom/search.py
--- a/pogom/search.py
+++ b/pogom/search.py
@@ -672,6 +672,10 @@ def search_worker_thread(args, account_queue, account_failures,
     # This reinitializes the API and grabs a new account from the queue.
     while True:
         try:
+            # Force storing of previous worker info to keep consistency
+            if 'starttime' in status:
+                dbq.put((WorkerStatus, {0: WorkerStatus.db_format(status)}))
+
             status['starttime'] = now()
 
             # Track per loop.


Test patch:
Repository: RocketMap/RocketMap

Issue:
hlvl-kph is not working (high level encounters)
## Expected Behavior
Level 30 accounts to scan according to the speed limit.

## Current Behavior
Speed limit isn't working:
- scans over 11 minutes
- the 1st level 30 account has 362 encounters out of 503
- average time between encounters for 1st account is 2 seconds
- no captcha was triggered
- I did NOT check distance between spawns

Log containing location and time stamps:
https://app.box.com/s/jt0vyntql6rtlkdyyo5qasq1fm277cbo

## Possible Solution

## Steps to Reproduce (for bugs)
1. Enable verbose to a log file
2. Add pidgey, ratatta and other common pokemon to the whitelist encounter list.
3. Scan for 10-20 minutes
4. Check the log to see which level 30 accounts are encountering pokemon and how often

## Context
Is the behavior correct? Are the accounts not scanning too often over too great of a distance?
Might this get the accounts banned?
Maybe they are not even providing GPS location and only snipping (safe for now?).

## Your Environment
Stock develop
Python 2.7
Windows 10



Discussion:
Confirmed. Also found the source, the timing got wrongly committed. Fix coming in ~5 to 15 minutes.

Resolving patch:
diff --git a/pogom/account.py b/pogom/account.py
--- a/pogom/account.py
+++ b/pogom/account.py
@@ -412,7 +412,7 @@ def next(self, set_name, coords_to_scan):
                     distance_km = equi_rect_distance(
                         old_coords,
                         coords_to_scan)
-                    cooldown_time_sec = distance_km / max_speed_kmph
+                    cooldown_time_sec = distance_km / max_speed_kmph * 3600
 
                     # Not enough time has passed for this one.
                     if seconds_passed < cooldown_time_sec:


Test patch:
Repository: RocketMap/RocketMap

Issue:
Raids battles info
# **Current Behavior**
Too large eggs and bosses on the map
![screenshot_24](https://user-images.githubusercontent.com/6386996/27993939-684807e4-64bb-11e7-83a0-5ee190dce71b.jpg)
# **Expected Behavior**
Standart gym-icon with additional icon of raid boss level
# **Possible Solution**
Show red (active), pink (expected) icon on the left bottom with raid boss level
All additional information show in gym-info tab only
It would be great if raid battle shows something like this
![raid](https://user-images.githubusercontent.com/6386996/27993749-79088e1c-64b8-11e7-9ab4-137bac55ff1f.png)
# **P.S.**
Also would be great to see some filter and notifications of raid levels/bosses
Example: Notify of all Tyranitar bosses on the scan area


Discussion:

Resolving patch:
diff --git a/pogom/models.py b/pogom/models.py
--- a/pogom/models.py
+++ b/pogom/models.py
@@ -558,7 +558,8 @@ def get_gym(id):
                               Gym.latitude,
                               Gym.longitude,
                               Gym.last_modified,
-                              Gym.last_scanned)
+                              Gym.last_scanned,
+                              Gym.total_cp)
                       .join(GymDetails, JOIN.LEFT_OUTER,
                             on=(Gym.gym_id == GymDetails.gym_id))
                       .where(Gym.gym_id == id)


Test patch: