instance_id string | repo string | language string | domain string | image_name string | original_image_name string | image_digest string | image_id string | workdir string | problem_statement string | patch string | injection_patch string | test_patch string | FAIL_TO_PASS list | PASS_TO_PASS list | correct_file_sha256 string | buggy_file_sha256 string | target_file string | split string | base_commit string | requires_instance_preparation bool | requires_new_image bool | test_cmd string | test_files list |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sweas_6b931b7f61b2c4949e23f2ad | weaveworks/grafanalib | python | devops_infra | swebench/swesmith.x86_64.weaveworks_1776_grafanalib.5c3b17ed@sha256:a5cf1839d25a0567a65b0907dc7b40574764173f1cf084fa5a5665c02a56236a | swebench/swesmith.x86_64.weaveworks_1776_grafanalib.5c3b17ed | sha256:a5cf1839d25a0567a65b0907dc7b40574764173f1cf084fa5a5665c02a56236a | sha256:543336df755bcf897679a5569e4c977a2624edd497d4c579268b1aeb4040cc93 | /testbed | Dashboard generation fails with `NameError: name 'gtype' is not defined`
### Description
Trying to generate a dashboard from a definition file now fails before producing any output. I first noticed it while running the files in `examples/`, but a minimal dashboard definition does the same thing.
### Steps to Reprodu... | diff --git a/grafanalib/_gen.py b/grafanalib/_gen.py
index 245a6e1..4094edf 100644
--- a/grafanalib/_gen.py
+++ b/grafanalib/_gen.py
@@ -51,10 +51,16 @@ def loader(path):
:param str path: Path to a *.<type>.py file that defines a variable called <type>.
"""
+ gtype = path.split(".")[-2]
+
if sys.ver... | diff --git a/grafanalib/_gen.py b/grafanalib/_gen.py
index 4094edf..245a6e1 100644
--- a/grafanalib/_gen.py
+++ b/grafanalib/_gen.py
@@ -51,16 +51,10 @@ def loader(path):
:param str path: Path to a *.<type>.py file that defines a variable called <type>.
"""
- gtype = path.split(".")[-2]
-
if sys.ver... | [
"grafanalib/tests/test_examples.py::test_examples"
] | [
"grafanalib/tests/test_azuredataexplorer.py::test_serialization_azuredataexplorer_metrics_target",
"grafanalib/tests/test_azuremonitor.py::test_serialization_azure_graph_target",
"grafanalib/tests/test_azuremonitor.py::test_serialization_azure_logs_target",
"grafanalib/tests/test_azuremonitor.py::test_seriali... | 9219542817deb0a1ff2ef725aba1bb1fc835cf36eff3476c076bf2dcafcafd5f | e56a89f88a38b51bb258888034c1aedd900c236a8d4cb7061f5ca93163f10b11 | grafanalib/_gen.py | train | 837ba8e8fa6f1e4fb1f726ff923e10823e0ccfe4 | true | false | source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose | [] | |
sweas_dfde9429d0951109b607a318 | weaveworks/grafanalib | python | devops_infra | swebench/swesmith.x86_64.weaveworks_1776_grafanalib.5c3b17ed@sha256:a5cf1839d25a0567a65b0907dc7b40574764173f1cf084fa5a5665c02a56236a | swebench/swesmith.x86_64.weaveworks_1776_grafanalib.5c3b17ed | sha256:a5cf1839d25a0567a65b0907dc7b40574764173f1cf084fa5a5665c02a56236a | sha256:543336df755bcf897679a5569e4c977a2624edd497d4c579268b1aeb4040cc93 | /testbed | # `AzureMonitorMetricsTarget` no longer accepts `aggregation`
### Description
After updating grafanalib, existing Azure Monitor metric targets that pass an `aggregation` value fail during construction. For example, `aggregation="Total"` is a common Azure Monitor metric option and used to serialize fine. This looks lik... | diff --git a/grafanalib/azuremonitor.py b/grafanalib/azuremonitor.py
index 94cf40d..7cb324e 100644
--- a/grafanalib/azuremonitor.py
+++ b/grafanalib/azuremonitor.py
@@ -1,6 +1,7 @@
"""Helpers to create Azure Monitor specific Grafana queries."""
import attr
+from attr.validators import instance_of
@attr.s
@@ -2... | diff --git a/grafanalib/azuremonitor.py b/grafanalib/azuremonitor.py
index 7cb324e..94cf40d 100644
--- a/grafanalib/azuremonitor.py
+++ b/grafanalib/azuremonitor.py
@@ -1,7 +1,6 @@
"""Helpers to create Azure Monitor specific Grafana queries."""
import attr
-from attr.validators import instance_of
@attr.s
@@ -2... | [
"grafanalib/tests/test_azuremonitor.py::test_serialization_azure_metrics_target"
] | [
"grafanalib/tests/test_azuredataexplorer.py::test_serialization_azuredataexplorer_metrics_target",
"grafanalib/tests/test_azuremonitor.py::test_serialization_azure_graph_target",
"grafanalib/tests/test_azuremonitor.py::test_serialization_azure_logs_target",
"grafanalib/tests/test_cloudwatch.py::test_cloudwatc... | 4fc8e732f56f49158d6b893402c37ea4be14b267ad1d834bb7172acd656b890c | f4e27f18c36e689e58f04ee1395d6f7b9515471cd98c3570da028918f5940d7c | grafanalib/azuremonitor.py | train | 837ba8e8fa6f1e4fb1f726ff923e10823e0ccfe4 | true | false | source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose | [] | |
sweas_824c8a1af092d46a15f61a4e | weaveworks/grafanalib | python | devops_infra | swebench/swesmith.x86_64.weaveworks_1776_grafanalib.5c3b17ed@sha256:a5cf1839d25a0567a65b0907dc7b40574764173f1cf084fa5a5665c02a56236a | swebench/swesmith.x86_64.weaveworks_1776_grafanalib.5c3b17ed | sha256:a5cf1839d25a0567a65b0907dc7b40574764173f1cf084fa5a5665c02a56236a | sha256:543336df755bcf897679a5569e4c977a2624edd497d4c579268b1aeb4040cc93 | /testbed | Serializing `CloudwatchMetricsTarget` raises AttributeError for missing `account`
### Description
After updating, any dashboard that includes a `CloudwatchMetricsTarget` can no longer be serialized. Creating the target works fine, but writing the dashboard out fails with an `AttributeError` about a missing `account` ... | diff --git a/grafanalib/cloudwatch.py b/grafanalib/cloudwatch.py
index e030724..9aadae4 100644
--- a/grafanalib/cloudwatch.py
+++ b/grafanalib/cloudwatch.py
@@ -21,6 +21,8 @@ class CloudwatchMetricsTarget(Target):
:param dimensions: Cloudwatch dimensions dict
:param expression: Cloudwatch Metric math expressi... | diff --git a/grafanalib/cloudwatch.py b/grafanalib/cloudwatch.py
index 9aadae4..e030724 100644
--- a/grafanalib/cloudwatch.py
+++ b/grafanalib/cloudwatch.py
@@ -21,8 +21,6 @@ class CloudwatchMetricsTarget(Target):
:param dimensions: Cloudwatch dimensions dict
:param expression: Cloudwatch Metric math expressi... | [
"grafanalib/tests/test_cloudwatch.py::test_serialization_cloudwatch_metrics_target"
] | [
"grafanalib/tests/test_azuredataexplorer.py::test_serialization_azuredataexplorer_metrics_target",
"grafanalib/tests/test_azuremonitor.py::test_serialization_azure_graph_target",
"grafanalib/tests/test_azuremonitor.py::test_serialization_azure_logs_target",
"grafanalib/tests/test_azuremonitor.py::test_seriali... | f1cf3db6fa1a9e36dc86e8d6c2314f737963e5fea7cf2822add3448886b37d6f | b4c2b9aecea7e3b6804ded01bc285ef2ed4efb32b4e66caeeedc94d82348a440 | grafanalib/cloudwatch.py | train | 837ba8e8fa6f1e4fb1f726ff923e10823e0ccfe4 | true | false | source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose | [] | |
sweas_f1f8efed014045ae2a4f9250 | weaveworks/grafanalib | python | devops_infra | swebench/swesmith.x86_64.weaveworks_1776_grafanalib.5c3b17ed@sha256:a5cf1839d25a0567a65b0907dc7b40574764173f1cf084fa5a5665c02a56236a | swebench/swesmith.x86_64.weaveworks_1776_grafanalib.5c3b17ed | sha256:a5cf1839d25a0567a65b0907dc7b40574764173f1cf084fa5a5665c02a56236a | sha256:543336df755bcf897679a5569e4c977a2624edd497d4c579268b1aeb4040cc93 | /testbed | ### CloudWatch targets no longer include `hide` in serialized JSON
The `hide` field on CloudWatch targets appears to have been dropped. Grafana uses this property to control whether a target is displayed on a visualization, and it affects both `CloudwatchMetricsTarget` and `CloudwatchLogsInsightsTarget`.
### Expected... | diff --git a/grafanalib/cloudwatch.py b/grafanalib/cloudwatch.py
index 0a1255a..9aadae4 100644
--- a/grafanalib/cloudwatch.py
+++ b/grafanalib/cloudwatch.py
@@ -31,6 +31,7 @@ class CloudwatchMetricsTarget(Target):
:param region: Cloudwatch region
:param statistics: Cloudwatch mathematic statistics (to be depr... | diff --git a/grafanalib/cloudwatch.py b/grafanalib/cloudwatch.py
index 9aadae4..0a1255a 100644
--- a/grafanalib/cloudwatch.py
+++ b/grafanalib/cloudwatch.py
@@ -31,7 +31,6 @@ class CloudwatchMetricsTarget(Target):
:param region: Cloudwatch region
:param statistics: Cloudwatch mathematic statistics (to be depr... | [
"grafanalib/tests/test_cloudwatch.py::test_cloudwatch_logs_insights_target"
] | [
"grafanalib/tests/test_azuredataexplorer.py::test_serialization_azuredataexplorer_metrics_target",
"grafanalib/tests/test_azuremonitor.py::test_serialization_azure_graph_target",
"grafanalib/tests/test_azuremonitor.py::test_serialization_azure_logs_target",
"grafanalib/tests/test_azuremonitor.py::test_seriali... | f1cf3db6fa1a9e36dc86e8d6c2314f737963e5fea7cf2822add3448886b37d6f | aa4519f2c0713ad3b8b6beaf876ab4ccc690270195576cd7895798ecb767e68b | grafanalib/cloudwatch.py | train | 837ba8e8fa6f1e4fb1f726ff923e10823e0ccfe4 | true | false | source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose | [] | |
sweas_d7f58dfc91e765a06fddc492 | weaveworks/grafanalib | python | devops_infra | swebench/swesmith.x86_64.weaveworks_1776_grafanalib.5c3b17ed@sha256:a5cf1839d25a0567a65b0907dc7b40574764173f1cf084fa5a5665c02a56236a | swebench/swesmith.x86_64.weaveworks_1776_grafanalib.5c3b17ed | sha256:a5cf1839d25a0567a65b0907dc7b40574764173f1cf084fa5a5665c02a56236a | sha256:543336df755bcf897679a5569e4c977a2624edd497d4c579268b1aeb4040cc93 | /testbed | # Cloudwatch targets no longer emit `queryMode` in generated JSON
### Description
When generating a dashboard using `CloudwatchLogsInsightsTarget`, the resulting JSON no longer contains the `queryMode` field. Grafana expects this to be set to `"Logs"` for Logs Insights queries. The metrics target also no longer accep... | diff --git a/grafanalib/cloudwatch.py b/grafanalib/cloudwatch.py
index 461e6cb..9aadae4 100644
--- a/grafanalib/cloudwatch.py
+++ b/grafanalib/cloudwatch.py
@@ -33,6 +33,7 @@ class CloudwatchMetricsTarget(Target):
:param statistic: Cloudwatch mathematic statistic
:param hide: controls if given metric is displ... | diff --git a/grafanalib/cloudwatch.py b/grafanalib/cloudwatch.py
index 9aadae4..461e6cb 100644
--- a/grafanalib/cloudwatch.py
+++ b/grafanalib/cloudwatch.py
@@ -33,7 +33,6 @@ class CloudwatchMetricsTarget(Target):
:param statistic: Cloudwatch mathematic statistic
:param hide: controls if given metric is displ... | [
"grafanalib/tests/test_cloudwatch.py::test_cloudwatch_logs_insights_target"
] | [
"grafanalib/tests/test_azuredataexplorer.py::test_serialization_azuredataexplorer_metrics_target",
"grafanalib/tests/test_azuremonitor.py::test_serialization_azure_graph_target",
"grafanalib/tests/test_azuremonitor.py::test_serialization_azure_logs_target",
"grafanalib/tests/test_azuremonitor.py::test_seriali... | f1cf3db6fa1a9e36dc86e8d6c2314f737963e5fea7cf2822add3448886b37d6f | ba2d5cdda1443941700f509bd712cdbf56a9f3674e8195bd1a81f35a34f4c87e | grafanalib/cloudwatch.py | train | 837ba8e8fa6f1e4fb1f726ff923e10823e0ccfe4 | true | false | source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose | [] | |
sweas_ab588f661c6634cf8b382f66 | weaveworks/grafanalib | python | devops_infra | swebench/swesmith.x86_64.weaveworks_1776_grafanalib.5c3b17ed@sha256:a5cf1839d25a0567a65b0907dc7b40574764173f1cf084fa5a5665c02a56236a | swebench/swesmith.x86_64.weaveworks_1776_grafanalib.5c3b17ed | sha256:a5cf1839d25a0567a65b0907dc7b40574764173f1cf084fa5a5665c02a56236a | sha256:543336df755bcf897679a5569e4c977a2624edd497d4c579268b1aeb4040cc93 | /testbed | **RateMetricAgg no longer accepts `mode` parameter**
### Description
After upgrading to the latest version, creating a `RateMetricAgg` with the `mode` argument raises a `TypeError`. This used to work and was a documented way to set the aggregation mode (e.g., `"sum"` or `"value_count"`). Our dashboards rely on this to... | diff --git a/grafanalib/elasticsearch.py b/grafanalib/elasticsearch.py
index 1c38f58..bf4cb29 100644
--- a/grafanalib/elasticsearch.py
+++ b/grafanalib/elasticsearch.py
@@ -520,6 +520,7 @@ class RateMetricAgg(object):
"month"
"quarter"
"year"
+ :param mode: sum or count the values
:pa... | diff --git a/grafanalib/elasticsearch.py b/grafanalib/elasticsearch.py
index bf4cb29..1c38f58 100644
--- a/grafanalib/elasticsearch.py
+++ b/grafanalib/elasticsearch.py
@@ -520,7 +520,6 @@ class RateMetricAgg(object):
"month"
"quarter"
"year"
- :param mode: sum or count the values
:pa... | [
"grafanalib/tests/test_elasticsearch.py::test_rate_metric_agg"
] | [
"grafanalib/tests/test_azuredataexplorer.py::test_serialization_azuredataexplorer_metrics_target",
"grafanalib/tests/test_azuremonitor.py::test_serialization_azure_graph_target",
"grafanalib/tests/test_azuremonitor.py::test_serialization_azure_logs_target",
"grafanalib/tests/test_azuremonitor.py::test_seriali... | 729f0c7119eb5c76e4b0605413890511e3bf434c0ab511f309bd7d3cf1c5a457 | ac5bedb0f8c6ffbd4fac18ca51b1dea0df5d8c960df201ba64b866f9c8801a6a | grafanalib/elasticsearch.py | train | 837ba8e8fa6f1e4fb1f726ff923e10823e0ccfe4 | true | false | source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose | [] | |
sweas_aeaaf84504aac40730ffe7e6 | weaveworks/grafanalib | python | devops_infra | swebench/swesmith.x86_64.weaveworks_1776_grafanalib.5c3b17ed@sha256:a5cf1839d25a0567a65b0907dc7b40574764173f1cf084fa5a5665c02a56236a | swebench/swesmith.x86_64.weaveworks_1776_grafanalib.5c3b17ed | sha256:a5cf1839d25a0567a65b0907dc7b40574764173f1cf084fa5a5665c02a56236a | sha256:543336df755bcf897679a5569e4c977a2624edd497d4c579268b1aeb4040cc93 | /testbed | **`RateMetricAgg` serializes the wrong `mode` value**
When creating a `RateMetricAgg` with an explicit `mode`, the generated JSON does not preserve it. For example:
```python
from grafanalib.elasticsearch import RateMetricAgg
t = RateMetricAgg(field="some-field", mode="sum")
print(t.to_json_data())
```
Expected the... | diff --git a/grafanalib/elasticsearch.py b/grafanalib/elasticsearch.py
index 2401883..bf4cb29 100644
--- a/grafanalib/elasticsearch.py
+++ b/grafanalib/elasticsearch.py
@@ -528,7 +528,7 @@ class RateMetricAgg(object):
id = attr.ib(default=0, validator=instance_of(int))
hide = attr.ib(default=False, validator=... | diff --git a/grafanalib/elasticsearch.py b/grafanalib/elasticsearch.py
index bf4cb29..2401883 100644
--- a/grafanalib/elasticsearch.py
+++ b/grafanalib/elasticsearch.py
@@ -528,7 +528,7 @@ class RateMetricAgg(object):
id = attr.ib(default=0, validator=instance_of(int))
hide = attr.ib(default=False, validator=... | [
"grafanalib/tests/test_elasticsearch.py::test_rate_metric_agg"
] | [
"grafanalib/tests/test_azuredataexplorer.py::test_serialization_azuredataexplorer_metrics_target",
"grafanalib/tests/test_azuremonitor.py::test_serialization_azure_graph_target",
"grafanalib/tests/test_azuremonitor.py::test_serialization_azure_logs_target",
"grafanalib/tests/test_azuremonitor.py::test_seriali... | 729f0c7119eb5c76e4b0605413890511e3bf434c0ab511f309bd7d3cf1c5a457 | 7369d0b1f3ec77fc55259e536ff30cf5f2fd7ed34d56558e95bee2a5304c3e05 | grafanalib/elasticsearch.py | train | 837ba8e8fa6f1e4fb1f726ff923e10823e0ccfe4 | true | false | source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose | [] | |
sweas_53778f1b0803b3e66fcf5726 | weaveworks/grafanalib | python | devops_infra | swebench/swesmith.x86_64.weaveworks_1776_grafanalib.5c3b17ed@sha256:a5cf1839d25a0567a65b0907dc7b40574764173f1cf084fa5a5665c02a56236a | swebench/swesmith.x86_64.weaveworks_1776_grafanalib.5c3b17ed | sha256:a5cf1839d25a0567a65b0907dc7b40574764173f1cf084fa5a5665c02a56236a | sha256:543336df755bcf897679a5569e4c977a2624edd497d4c579268b1aeb4040cc93 | /testbed | **HumioTarget serialization fails with `AttributeError: 'HumioTarget' object has no attribute 'refId'`**
### Description
Creating a `HumioTarget` and serializing a dashboard that uses it raises an `AttributeError` because the target no longer has a `refId` attribute, but its `to_json_data()` method still tries to acc... | diff --git a/grafanalib/humio.py b/grafanalib/humio.py
index 4dbc1c9..6bff77a 100644
--- a/grafanalib/humio.py
+++ b/grafanalib/humio.py
@@ -2,6 +2,7 @@
import attr
+
@attr.s
class HumioTarget(object):
"""
@@ -18,6 +19,7 @@ class HumioTarget(object):
humioQuery = attr.ib(default="")
humioReposit... | diff --git a/grafanalib/humio.py b/grafanalib/humio.py
index 6bff77a..4dbc1c9 100644
--- a/grafanalib/humio.py
+++ b/grafanalib/humio.py
@@ -2,7 +2,6 @@
import attr
-
@attr.s
class HumioTarget(object):
"""
@@ -19,7 +18,6 @@ class HumioTarget(object):
humioQuery = attr.ib(default="")
humioReposit... | [
"grafanalib/tests/test_humio.py::test_serialization_humio_metrics_target"
] | [
"grafanalib/tests/test_azuredataexplorer.py::test_serialization_azuredataexplorer_metrics_target",
"grafanalib/tests/test_azuremonitor.py::test_serialization_azure_graph_target",
"grafanalib/tests/test_azuremonitor.py::test_serialization_azure_logs_target",
"grafanalib/tests/test_azuremonitor.py::test_seriali... | ecc544d10a314667f120534958f585478c44a40a2a2314c33fade2dbbecf076a | 486f787ef35a25dd715aade8da8ed24bfd7f021c09a9cdf554661071ac7b6c48 | grafanalib/humio.py | train | 837ba8e8fa6f1e4fb1f726ff923e10823e0ccfe4 | true | false | source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose | [] | |
sweas_259986bb041fe88a0e43e807 | weaveworks/grafanalib | python | devops_infra | swebench/swesmith.x86_64.weaveworks_1776_grafanalib.5c3b17ed@sha256:a5cf1839d25a0567a65b0907dc7b40574764173f1cf084fa5a5665c02a56236a | swebench/swesmith.x86_64.weaveworks_1776_grafanalib.5c3b17ed | sha256:a5cf1839d25a0567a65b0907dc7b40574764173f1cf084fa5a5665c02a56236a | sha256:543336df755bcf897679a5569e4c977a2624edd497d4c579268b1aeb4040cc93 | /testbed | Serializing a `HumioTarget` raises `AttributeError`
When adding a `HumioTarget` to a dashboard and writing it out, serialization fails instead of producing the Humio target JSON.
### Steps to Reproduce
```python
import grafanalib.core as G
import grafanalib.humio as H
from grafanalib import _gen
from io import Strin... | diff --git a/grafanalib/humio.py b/grafanalib/humio.py
index 6ff07f2..6bff77a 100644
--- a/grafanalib/humio.py
+++ b/grafanalib/humio.py
@@ -1,9 +1,9 @@
"""Helpers to create Humio-specific Grafana queries."""
-import attr as attrs
+import attr
-@attrs.define
+@attr.s
class HumioTarget(object):
"""
Gen... | diff --git a/grafanalib/humio.py b/grafanalib/humio.py
index 6bff77a..6ff07f2 100644
--- a/grafanalib/humio.py
+++ b/grafanalib/humio.py
@@ -1,9 +1,9 @@
"""Helpers to create Humio-specific Grafana queries."""
-import attr
+import attr as attrs
-@attr.s
+@attrs.define
class HumioTarget(object):
"""
Gen... | [
"grafanalib/tests/test_humio.py::test_serialization_humio_metrics_target"
] | [
"grafanalib/tests/test_azuredataexplorer.py::test_serialization_azuredataexplorer_metrics_target",
"grafanalib/tests/test_azuremonitor.py::test_serialization_azure_graph_target",
"grafanalib/tests/test_azuremonitor.py::test_serialization_azure_logs_target",
"grafanalib/tests/test_azuremonitor.py::test_seriali... | ecc544d10a314667f120534958f585478c44a40a2a2314c33fade2dbbecf076a | 1bd3f7a64f1970abe3a403e0831a27a88e098b7da7bb58b45b247d81a97cb44d | grafanalib/humio.py | train | 837ba8e8fa6f1e4fb1f726ff923e10823e0ccfe4 | true | false | source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose | [] | |
sweas_c94d4bb7201184a422bf3047 | weaveworks/grafanalib | python | devops_infra | swebench/swesmith.x86_64.weaveworks_1776_grafanalib.5c3b17ed@sha256:a5cf1839d25a0567a65b0907dc7b40574764173f1cf084fa5a5665c02a56236a | swebench/swesmith.x86_64.weaveworks_1776_grafanalib.5c3b17ed | sha256:a5cf1839d25a0567a65b0907dc7b40574764173f1cf084fa5a5665c02a56236a | sha256:543336df755bcf897679a5569e4c977a2624edd497d4c579268b1aeb4040cc93 | /testbed | # `HumioTarget` no longer allows empty/default construction
### Description
After the recent changes, `HumioTarget` no longer accepts being constructed without explicitly passing every field. Previously the fields defaulted to empty strings, so `HumioTarget()` could be used directly in dashboard targets.
### Expecte... | diff --git a/grafanalib/humio.py b/grafanalib/humio.py
index 1cf37ef..6bff77a 100644
--- a/grafanalib/humio.py
+++ b/grafanalib/humio.py
@@ -1,7 +1,10 @@
"""Helpers to create Humio-specific Grafana queries."""
+import attr
+
+
+@attr.s
class HumioTarget(object):
- """Generates Humio target JSON structure."""
... | diff --git a/grafanalib/humio.py b/grafanalib/humio.py
index 6bff77a..1cf37ef 100644
--- a/grafanalib/humio.py
+++ b/grafanalib/humio.py
@@ -1,10 +1,7 @@
"""Helpers to create Humio-specific Grafana queries."""
-import attr
-
-
-@attr.s
class HumioTarget(object):
+ """Generates Humio target JSON structure."""
... | [
"grafanalib/tests/test_humio.py::test_serialization_humio_metrics_target"
] | [
"grafanalib/tests/test_azuredataexplorer.py::test_serialization_azuredataexplorer_metrics_target",
"grafanalib/tests/test_azuremonitor.py::test_serialization_azure_graph_target",
"grafanalib/tests/test_azuremonitor.py::test_serialization_azure_logs_target",
"grafanalib/tests/test_azuremonitor.py::test_seriali... | ecc544d10a314667f120534958f585478c44a40a2a2314c33fade2dbbecf076a | 7e33ccdebf2714dca8c145b0f118acb22f4fac30cd466543e5d1efa23b4c34a4 | grafanalib/humio.py | train | 837ba8e8fa6f1e4fb1f726ff923e10823e0ccfe4 | true | false | source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose | [] | |
sweas_cd9f79b6a9416cd3814a280a | weaveworks/grafanalib | python | devops_infra | swebench/swesmith.x86_64.weaveworks_1776_grafanalib.5c3b17ed@sha256:a5cf1839d25a0567a65b0907dc7b40574764173f1cf084fa5a5665c02a56236a | swebench/swesmith.x86_64.weaveworks_1776_grafanalib.5c3b17ed | sha256:a5cf1839d25a0567a65b0907dc7b40574764173f1cf084fa5a5665c02a56236a | sha256:543336df755bcf897679a5569e4c977a2624edd497d4c579268b1aeb4040cc93 | /testbed | # `generate-dashboard` crashes while loading dashboard definitions
When trying to generate JSON from a dashboard definition file, `grafanalib` fails while loading the definition.
### Expected behavior
The dashboard definition should load and the generated JSON should be printed, as before.
### Actual behavior
The ... | diff --git a/grafanalib/_gen.py b/grafanalib/_gen.py
index c84bd29..4094edf 100644
--- a/grafanalib/_gen.py
+++ b/grafanalib/_gen.py
@@ -2,6 +2,8 @@
import argparse
import json
+import os
+import sys
DASHBOARD_SUFFIX = '.dashboard.py'
@@ -51,10 +53,20 @@ def loader(path):
"""
gtype = path.split(".")[... | diff --git a/grafanalib/_gen.py b/grafanalib/_gen.py
index 4094edf..c84bd29 100644
--- a/grafanalib/_gen.py
+++ b/grafanalib/_gen.py
@@ -2,8 +2,6 @@
import argparse
import json
-import os
-import sys
DASHBOARD_SUFFIX = '.dashboard.py'
@@ -53,20 +51,10 @@ def loader(path):
"""
gtype = path.split(".")[... | [
"grafanalib/tests/test_examples.py::test_examples"
] | [
"grafanalib/tests/test_azuredataexplorer.py::test_serialization_azuredataexplorer_metrics_target",
"grafanalib/tests/test_azuremonitor.py::test_serialization_azure_graph_target",
"grafanalib/tests/test_azuremonitor.py::test_serialization_azure_logs_target",
"grafanalib/tests/test_azuremonitor.py::test_seriali... | 9219542817deb0a1ff2ef725aba1bb1fc835cf36eff3476c076bf2dcafcafd5f | 6ab67fd001e68437769e36dec2956caa42144cc727d9f0a927ab60a603dde751 | grafanalib/_gen.py | train | 837ba8e8fa6f1e4fb1f726ff923e10823e0ccfe4 | true | false | source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose | [] | |
sweas_6b46a127632e8a15ea4699e8 | weaveworks/grafanalib | python | devops_infra | swebench/swesmith.x86_64.weaveworks_1776_grafanalib.5c3b17ed@sha256:a5cf1839d25a0567a65b0907dc7b40574764173f1cf084fa5a5665c02a56236a | swebench/swesmith.x86_64.weaveworks_1776_grafanalib.5c3b17ed | sha256:a5cf1839d25a0567a65b0907dc7b40574764173f1cf084fa5a5665c02a56236a | sha256:543336df755bcf897679a5569e4c977a2624edd497d4c579268b1aeb4040cc93 | /testbed | # AzureDataExplorerTarget raises `TypeError` when instantiated
Creating an `AzureDataExplorerTarget` now raises an exception, which makes it impossible to build an Azure Data Explorer graph:
```python
TypeError: __init__() should return None, not 'dict'
```
### Expected behavior
`AzureDataExplorerTarget()` should c... | diff --git a/grafanalib/azuredataexplorer.py b/grafanalib/azuredataexplorer.py
index 238fc73..9589d25 100644
--- a/grafanalib/azuredataexplorer.py
+++ b/grafanalib/azuredataexplorer.py
@@ -1,8 +1,13 @@
"""Helpers to create Azure Data Explorer specific Grafana queries."""
-"""
-Azure Data Explorer target JSON structu... | diff --git a/grafanalib/azuredataexplorer.py b/grafanalib/azuredataexplorer.py
index 9589d25..238fc73 100644
--- a/grafanalib/azuredataexplorer.py
+++ b/grafanalib/azuredataexplorer.py
@@ -1,13 +1,8 @@
"""Helpers to create Azure Data Explorer specific Grafana queries."""
-import attr
-
-TIME_SERIES_RESULT_FORMAT = '... | [
"grafanalib/tests/test_azuredataexplorer.py::test_serialization_azuredataexplorer_metrics_target"
] | [
"grafanalib/tests/test_azuremonitor.py::test_serialization_azure_graph_target",
"grafanalib/tests/test_azuremonitor.py::test_serialization_azure_logs_target",
"grafanalib/tests/test_azuremonitor.py::test_serialization_azure_metrics_target",
"grafanalib/tests/test_cloudwatch.py::test_cloudwatch_logs_insights_t... | 7e77876dd53d25ec08a8f5dce1351c66ada4abfb4dc08af290684d256e2fb567 | c481aabf31214a057740c43a20b3237cf586967dc74f5e89658fb0e10ddd4673 | grafanalib/azuredataexplorer.py | train | 837ba8e8fa6f1e4fb1f726ff923e10823e0ccfe4 | true | false | source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose | [] | |
sweas_9284d1d5fcc9aea1a59d39b5 | weaveworks/grafanalib | python | devops_infra | swebench/swesmith.x86_64.weaveworks_1776_grafanalib.5c3b17ed@sha256:a5cf1839d25a0567a65b0907dc7b40574764173f1cf084fa5a5665c02a56236a | swebench/swesmith.x86_64.weaveworks_1776_grafanalib.5c3b17ed | sha256:a5cf1839d25a0567a65b0907dc7b40574764173f1cf084fa5a5665c02a56236a | sha256:543336df755bcf897679a5569e4c977a2624edd497d4c579268b1aeb4040cc93 | /testbed | ElasticsearchTarget no longer has `auto_bucket_agg_ids`
### Description
It looks like the `auto_bucket_agg_ids()` helper on `ElasticsearchTarget` has disappeared. Dashboards that rely on it to fill in IDs for bucket aggregations now fail when they are generated.
### Steps to Reproduce
Use an Elasticsearch target with... | diff --git a/grafanalib/elasticsearch.py b/grafanalib/elasticsearch.py
index ef95afe..bf4cb29 100644
--- a/grafanalib/elasticsearch.py
+++ b/grafanalib/elasticsearch.py
@@ -1,6 +1,7 @@
"""Helpers to create Elasticsearch-specific Grafana queries."""
import attr
+import itertools
from attr.validators import in_, ins... | diff --git a/grafanalib/elasticsearch.py b/grafanalib/elasticsearch.py
index bf4cb29..ef95afe 100644
--- a/grafanalib/elasticsearch.py
+++ b/grafanalib/elasticsearch.py
@@ -1,7 +1,6 @@
"""Helpers to create Elasticsearch-specific Grafana queries."""
import attr
-import itertools
from attr.validators import in_, ins... | [
"grafanalib/tests/test_examples.py::test_examples"
] | [
"grafanalib/tests/test_azuredataexplorer.py::test_serialization_azuredataexplorer_metrics_target",
"grafanalib/tests/test_azuremonitor.py::test_serialization_azure_graph_target",
"grafanalib/tests/test_azuremonitor.py::test_serialization_azure_logs_target",
"grafanalib/tests/test_azuremonitor.py::test_seriali... | 729f0c7119eb5c76e4b0605413890511e3bf434c0ab511f309bd7d3cf1c5a457 | b0d064ca08d89a1d48bfeb4c5db226e4545cb6e93496e3185a83b0c4f416993c | grafanalib/elasticsearch.py | train | 837ba8e8fa6f1e4fb1f726ff923e10823e0ccfe4 | true | false | source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose | [] | |
sweas_835260377cfe2087a860ca9f | weaveworks/grafanalib | python | devops_infra | swebench/swesmith.x86_64.weaveworks_1776_grafanalib.5c3b17ed@sha256:a5cf1839d25a0567a65b0907dc7b40574764173f1cf084fa5a5665c02a56236a | swebench/swesmith.x86_64.weaveworks_1776_grafanalib.5c3b17ed | sha256:a5cf1839d25a0567a65b0907dc7b40574764173f1cf084fa5a5665c02a56236a | sha256:543336df755bcf897679a5569e4c977a2624edd497d4c579268b1aeb4040cc93 | /testbed | RateMetricAgg with a non-empty script raises TypeError during serialization
### Description
When a `RateMetricAgg` is created with a non-empty `script` string, calling `to_json_data()` raises a `TypeError` instead of serializing the script into the panel settings.
### Expected behavior
The generated JSON should inclu... | diff --git a/grafanalib/elasticsearch.py b/grafanalib/elasticsearch.py
index e581564..bf4cb29 100644
--- a/grafanalib/elasticsearch.py
+++ b/grafanalib/elasticsearch.py
@@ -529,7 +529,7 @@ class RateMetricAgg(object):
hide = attr.ib(default=False, validator=instance_of(bool))
unit = attr.ib(default="", valida... | diff --git a/grafanalib/elasticsearch.py b/grafanalib/elasticsearch.py
index bf4cb29..e581564 100644
--- a/grafanalib/elasticsearch.py
+++ b/grafanalib/elasticsearch.py
@@ -529,7 +529,7 @@ class RateMetricAgg(object):
hide = attr.ib(default=False, validator=instance_of(bool))
unit = attr.ib(default="", valida... | [
"grafanalib/tests/test_elasticsearch.py::test_rate_metric_agg"
] | [
"grafanalib/tests/test_azuredataexplorer.py::test_serialization_azuredataexplorer_metrics_target",
"grafanalib/tests/test_azuremonitor.py::test_serialization_azure_graph_target",
"grafanalib/tests/test_azuremonitor.py::test_serialization_azure_logs_target",
"grafanalib/tests/test_azuremonitor.py::test_seriali... | 729f0c7119eb5c76e4b0605413890511e3bf434c0ab511f309bd7d3cf1c5a457 | 4c5e7877125e0ecba0a11c32b761112bbfb9ff716f209a27f9670296bfa568cc | grafanalib/elasticsearch.py | train | 837ba8e8fa6f1e4fb1f726ff923e10823e0ccfe4 | true | false | source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose | [] | |
sweas_f681f9fd01049c18f9a5f433 | weaveworks/grafanalib | python | devops_infra | swebench/swesmith.x86_64.weaveworks_1776_grafanalib.5c3b17ed@sha256:a5cf1839d25a0567a65b0907dc7b40574764173f1cf084fa5a5665c02a56236a | swebench/swesmith.x86_64.weaveworks_1776_grafanalib.5c3b17ed | sha256:a5cf1839d25a0567a65b0907dc7b40574764173f1cf084fa5a5665c02a56236a | sha256:543336df755bcf897679a5569e4c977a2624edd497d4c579268b1aeb4040cc93 | /testbed | ### Description
When serializing Cloudwatch targets, the `region` (and for the metrics target, `matchExact`) fields are no longer included in the generated JSON. This means dashboards generated with grafanalib are missing these settings.
### Expected behavior
`to_json_data()` should include `"region": "default"` for... | diff --git a/grafanalib/cloudwatch.py b/grafanalib/cloudwatch.py
index 0e38259..9aadae4 100644
--- a/grafanalib/cloudwatch.py
+++ b/grafanalib/cloudwatch.py
@@ -31,34 +31,36 @@ class CloudwatchMetricsTarget(Target):
:param region: Cloudwatch region
:param statistics: Cloudwatch mathematic statistics (to be de... | diff --git a/grafanalib/cloudwatch.py b/grafanalib/cloudwatch.py
index 9aadae4..0e38259 100644
--- a/grafanalib/cloudwatch.py
+++ b/grafanalib/cloudwatch.py
@@ -31,36 +31,34 @@ class CloudwatchMetricsTarget(Target):
:param region: Cloudwatch region
:param statistics: Cloudwatch mathematic statistics (to be de... | [
"grafanalib/tests/test_cloudwatch.py::test_cloudwatch_logs_insights_target"
] | [
"grafanalib/tests/test_azuredataexplorer.py::test_serialization_azuredataexplorer_metrics_target",
"grafanalib/tests/test_azuremonitor.py::test_serialization_azure_graph_target",
"grafanalib/tests/test_azuremonitor.py::test_serialization_azure_logs_target",
"grafanalib/tests/test_azuremonitor.py::test_seriali... | f1cf3db6fa1a9e36dc86e8d6c2314f737963e5fea7cf2822add3448886b37d6f | 2b92266e11a1843724b4ebb44e9a1079c44b61e2773e33bbb4b6cef3f3820ca8 | grafanalib/cloudwatch.py | train | 837ba8e8fa6f1e4fb1f726ff923e10823e0ccfe4 | true | false | source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose | [] | |
sweas_0a198bc5df70c079c36b8cad | weaveworks/grafanalib | python | devops_infra | swebench/swesmith.x86_64.weaveworks_1776_grafanalib.5c3b17ed@sha256:a5cf1839d25a0567a65b0907dc7b40574764173f1cf084fa5a5665c02a56236a | swebench/swesmith.x86_64.weaveworks_1776_grafanalib.5c3b17ed | sha256:a5cf1839d25a0567a65b0907dc7b40574764173f1cf084fa5a5665c02a56236a | sha256:543336df755bcf897679a5569e4c977a2624edd497d4c579268b1aeb4040cc93 | /testbed | `generate_dashboard` raises a NameError before producing dashboard JSON
Generating a dashboard from a valid Python definition now stops immediately:
```text
NameError: name 'argparse' is not defined
```
For example:
```python
from pathlib import Path
from tempfile import TemporaryDirectory
from grafanalib import _g... | diff --git a/grafanalib/_gen.py b/grafanalib/_gen.py
index 7ffadc0..4094edf 100644
--- a/grafanalib/_gen.py
+++ b/grafanalib/_gen.py
@@ -1,5 +1,6 @@
"""Generate JSON Grafana dashboards."""
+import argparse
import json
import os
import sys
@@ -102,7 +103,13 @@ def get_alertgroup_json_path(path):
def alertgrou... | diff --git a/grafanalib/_gen.py b/grafanalib/_gen.py
index 4094edf..7ffadc0 100644
--- a/grafanalib/_gen.py
+++ b/grafanalib/_gen.py
@@ -1,6 +1,5 @@
"""Generate JSON Grafana dashboards."""
-import argparse
import json
import os
import sys
@@ -103,13 +102,7 @@ def get_alertgroup_json_path(path):
def alertgrou... | [
"grafanalib/tests/test_examples.py::test_examples"
] | [
"grafanalib/tests/test_azuredataexplorer.py::test_serialization_azuredataexplorer_metrics_target",
"grafanalib/tests/test_azuremonitor.py::test_serialization_azure_graph_target",
"grafanalib/tests/test_azuremonitor.py::test_serialization_azure_logs_target",
"grafanalib/tests/test_azuremonitor.py::test_seriali... | 9219542817deb0a1ff2ef725aba1bb1fc835cf36eff3476c076bf2dcafcafd5f | a8df0b36d50f4dfb9cd1830f9c99ec9fe201038d57a1088a85b198492bccf74d | grafanalib/_gen.py | train | 837ba8e8fa6f1e4fb1f726ff923e10823e0ccfe4 | true | false | source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose | [] | |
sweas_43c714ce85b896d1a96f899a | weaveworks/grafanalib | python | devops_infra | swebench/swesmith.x86_64.weaveworks_1776_grafanalib.5c3b17ed@sha256:a5cf1839d25a0567a65b0907dc7b40574764173f1cf084fa5a5665c02a56236a | swebench/swesmith.x86_64.weaveworks_1776_grafanalib.5c3b17ed | sha256:a5cf1839d25a0567a65b0907dc7b40574764173f1cf084fa5a5665c02a56236a | sha256:543336df755bcf897679a5569e4c977a2624edd497d4c579268b1aeb4040cc93 | /testbed | ### Description
When trying to generate an alertgroup from a Python script using `grafanalib._gen`, I get an `AttributeError`. The function `generate_alertgroup` seems to be missing.
### Steps to Reproduce
```python
from grafanalib import _gen
# Any alertgroup example file
_gen.generate_alertgroup(['examples/example.... | diff --git a/grafanalib/_gen.py b/grafanalib/_gen.py
index 08041f5..4094edf 100644
--- a/grafanalib/_gen.py
+++ b/grafanalib/_gen.py
@@ -127,6 +127,30 @@ def generate_alertgroups(args):
return 0
+def generate_alertgroup(args):
+ parser = argparse.ArgumentParser(prog='generate-alertgroup')
+ parser.add_ar... | diff --git a/grafanalib/_gen.py b/grafanalib/_gen.py
index 4094edf..08041f5 100644
--- a/grafanalib/_gen.py
+++ b/grafanalib/_gen.py
@@ -127,30 +127,6 @@ def generate_alertgroups(args):
return 0
-def generate_alertgroup(args):
- parser = argparse.ArgumentParser(prog='generate-alertgroup')
- parser.add_ar... | [
"grafanalib/tests/test_examples.py::test_examples"
] | [
"grafanalib/tests/test_azuredataexplorer.py::test_serialization_azuredataexplorer_metrics_target",
"grafanalib/tests/test_azuremonitor.py::test_serialization_azure_graph_target",
"grafanalib/tests/test_azuremonitor.py::test_serialization_azure_logs_target",
"grafanalib/tests/test_azuremonitor.py::test_seriali... | 9219542817deb0a1ff2ef725aba1bb1fc835cf36eff3476c076bf2dcafcafd5f | 725e7a387c8fd61226fa9316de6c7ded8e90f0a53af04cf4d797cda0053a6191 | grafanalib/_gen.py | train | 837ba8e8fa6f1e4fb1f726ff923e10823e0ccfe4 | true | false | source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose | [] |
SWE-at-Scale
SWE-at-Scale is a synthetic software engineering dataset generated using SWE-at-Scale and SWE-smith images. It contains 2,563 instances from 52 Python repositories.
Repositories represented in SWE-bench Verified are excluded.
Load
from datasets import load_dataset
data = load_dataset("SWE4ICLR2027/SWE-at-Scale", split="train")
Task fields
Each row includes an issue description (problem_statement), repository and target file,
the original image identity, the source commit (base_commit), an injection_patch,
the reference repair (patch), an optional test_patch, and the recorded
FAIL_TO_PASS and PASS_TO_PASS test identities. Source file SHA-256 values allow
the clean, injected and repaired file states to be checked.
base_commit is the clean source commit inside the original image. Apply
injection_patch before giving the task to an agent. The preparation helper
records that injected tree as a local task commit. patch repairs this injected
state; it is not a patch against the clean source. No new image is required.
Replay
Export one row to instance.json, and download the Python helpers in this repository
into the same directory. Mount that directory at /sweas in a fresh container
started from the row's image_name, and use the row's workdir as the working directory.
The helpers use the packages already installed in that image.
python /sweas/prepare.py /sweas/instance.json
Give the agent only the prepared repository and problem_statement. Keep the
reference patch, injection patch and evaluation files separate from its inputs.
For evaluation, apply test_patch when present and run test_cmd from the row:
python /sweas/prepare.py /sweas/instance.json --tests-only
The original test commands and scopes are preserved. Commands that use
run_tests.py emit per-test results. For the affected images the helper supplies
a pytest-snail teardown compatibility fix or
stable labels for two datetime parameters; test inputs and assertions are unchanged.
Recorded FAIL_TO_PASS tests fail in the injected state and pass after the reference
repair; PASS_TO_PASS tests pass in both states. Use --verify-repair during
preparation to check that the reference patch restores the clean tracked tree.
Repository source code and images remain subject to their respective upstream licenses.
- Downloads last month
- -