nebius/SWE-bench-extra huggingface dataset:
Repository: dandi/dandi-cli

Issue:
validate: crashes if file is not read ok
```shell
(git-annex)lena:~/proj/dandi/nwb-datasets[master]bendichter/Gao2018
$> dandi validate *nwb           
anm00314746_2015-10-20 09:36:04 (1).nwb: ok
anm00314746_2015-10-21 11:25:41 (1).nwb: ok
anm00314746_2015-10-22 15:17:38 (1).nwb: ok
anm00314756_2015-10-20 19:42:11 (1).nwb: ok
anm00314756_2015-10-23 14:10:29 (1).nwb: ok
anm00314757_2015-10-20 17:37:31 (1).nwb: ok
anm00314757_2015-10-21 18:02:48 (1).nwb: ok
anm00314758_2015-10-20 10:49:30.nwb: ok
anm00314758_2015-10-21 10:10:14 (1).nwb: ok
anm00314758_2015-10-22 11:20:47 (1).nwb: ok
anm00314758_2015-10-23 09:49:01 (1).nwb: ok
anm00314760_2015-10-20 15:52:30.nwb: ok
anm00314760_2015-10-21 16:44:27.nwb: ok
anm00314760_2015-10-22 16:39:13 (1).nwb: ok
BAYLORCD12_2018-01-25 19:16:01.nwb: ok
BAYLORCD12_2018-01-26 12:25:06.nwb: ok
Error: Could not construct DynamicTableRegion object due to The index 63 is out of range for this DynamicTable of length 63

$> dandi --version             
0.4.4+7.g2f45a27.dirty
```

Comments:

Patch:
diff --git a/dandi/validate.py b/dandi/validate.py
index a614bb7a..ff038262 100644
--- a/dandi/validate.py
+++ b/dandi/validate.py
@@ -51,7 +51,10 @@ def validate_dandi_nwb(filepath):
     """Provide validation of .nwb file regarding requirements we impose
     """
     # make sure that we have some basic metadata fields we require
-    meta = get_metadata(filepath)
+    try:
+        meta = get_metadata(filepath)
+    except BaseException as e:
+        return [f"Failed to read metadata: {e}"]
     return _check_required_fields(meta, _required_nwb_metadata_fields)
 
 


Test patch:
diff --git a/dandi/tests/test_validate.py b/dandi/tests/test_validate.py
index c125bdf8..5b350283 100644
--- a/dandi/tests/test_validate.py
+++ b/dandi/tests/test_validate.py
@@ -12,3 +12,15 @@ def test_validate_simple2(simple2_nwb):
     # this file should be ok
     errors = validate_file(simple2_nwb)
     assert not errors
+
+
+def test_validate_bogus(tmp_path):
+    path = tmp_path / "wannabe.nwb"
+    path.write_text("not really nwb")
+    # intended to produce use-case for https://github.com/dandi/dandi-cli/issues/93
+    # but it would be tricky, so it is more of a smoke test that
+    # we do not crash
+    errors = validate_file(str(path))
+    # ATM we would get 2 errors -- since could not be open in two places,
+    # but that would be too rigid to test. Let's just see that we have expected errors
+    assert any(e.startswith("Failed to read metadata") for e in errors)
Repository: dapr/python-sdk

Issue:
[BUG] DAPR_HEALTH_TIMEOUT as environment variable is not converted to numerical value
## Expected Behavior

When passing `DAPR_HEALTH_TIMEOUT` as environment variable it should be converted to a numerical value.


## Actual Behavior

docker container with env `DAPR_HEALTH_TIMEOUT=30` 

```timestamp="2024-03-22T11:03:26" level=ERROR message="Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 705, in lifespan
    async with self.lifespan_context(app) as maybe_state:
  File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/app/proxy/proxy_app.py", line 35, in lifespan
    DaprClient()
  File "/usr/local/lib/python3.11/site-packages/dapr/clients/__init__.py", line 81, in __init__
    super().__init__(address, interceptors, max_grpc_message_length)
  File "/usr/local/lib/python3.11/site-packages/dapr/clients/grpc/client.py", line 131, in __init__
    DaprHealth.wait_until_ready()
  File "/usr/local/lib/python3.11/site-packages/dapr/clients/health.py", line 45, in wait_until_ready
    remaining = (start + timeout) - time.time()
                 ~~~~~~^~~~~~~~~
TypeError: unsupported operand type(s) for +: 'float' and 'str'
```


## Steps to Reproduce the Problem

Start a docker container with an example env variable value `DAPR_HEALTH_TIMEOUT=30` and initialize `DaprClient()`


Comments:

Patch:
diff --git a/dapr/clients/health.py b/dapr/clients/health.py
index 120b559..e3daec7 100644
--- a/dapr/clients/health.py
+++ b/dapr/clients/health.py
@@ -28,7 +28,7 @@ class DaprHealth:
         headers = {USER_AGENT_HEADER: DAPR_USER_AGENT}
         if settings.DAPR_API_TOKEN is not None:
             headers[DAPR_API_TOKEN_HEADER] = settings.DAPR_API_TOKEN
-        timeout = settings.DAPR_HEALTH_TIMEOUT
+        timeout = float(settings.DAPR_HEALTH_TIMEOUT)
 
         start = time.time()
         while True:


Test patch:
diff --git a/tests/clients/test_heatlhcheck.py b/tests/clients/test_heatlhcheck.py
index 5c67c2c..f3be8a4 100644
--- a/tests/clients/test_heatlhcheck.py
+++ b/tests/clients/test_heatlhcheck.py
@@ -62,7 +62,7 @@ class DaprHealthCheckTests(unittest.TestCase):
         self.assertIn('Dapr-api-token', headers)
         self.assertEqual(headers['Dapr-api-token'], 'mytoken')
 
-    @patch.object(settings, 'DAPR_HEALTH_TIMEOUT', 2)
+    @patch.object(settings, 'DAPR_HEALTH_TIMEOUT', '2.5')
     @patch('urllib.request.urlopen')
     def test_wait_until_ready_timeout(self, mock_urlopen):
         mock_urlopen.return_value.__enter__.return_value = MagicMock(status=500)
@@ -72,5 +72,5 @@ class DaprHealthCheckTests(unittest.TestCase):
         with self.assertRaises(TimeoutError):
             DaprHealth.wait_until_ready()
 
-        self.assertGreaterEqual(time.time() - start, 2)
+        self.assertGreaterEqual(time.time() - start, 2.5)
         self.assertGreater(mock_urlopen.call_count, 1)