ted
(Ted Johansson)
13 مارس 2025، 10:01ص
9
كانت هناك بالفعل علة هنا، وبفضل تحقيق @Arkshine جزئيًا، كان من السهل نسبيًا إصلاحها:
main ← fix/report-generator-parameters
opened 09:29AM - 13 Mar 25 UTC
### What is the problem?
When setting up an automation to create a DM or a po… st with a report on a recurring basis, and using a Data Explorer query that has parameters, we encounter an error.
### Why is this happening?
The `.params_to_hash` currently expects an array of arrays for the parameters, e.g.:
```ruby
[["group_name", "admins"]]
```
but in reality they seem to be arrays of hashes:
```ruby
[{ "key" => "group_name", "value" => "admins" }]
```
### How come we only found out now?
We do have tests for the report generator, and we do pass query parameters to it, but 1) we hard-code the parameters as an array of arrays and 2) the parameters aren't in the query used as a fixture.
### How does this fix it?
This change makes `ReportGenerator.params_to_hash` work with arrays of hashes. It also preserves the ability to work with nested arrays in case this is used somewhere else.
تم دمج هذا بالفعل، لذلك بمجرد نشر موقعك، يجب أن يتم رفع الحظر عنك @ganncamp .
إذا فهمت بشكل صحيح، فأنت تريد أتمتة تكون عبارة عن تعيين واحد لواحد بين مجموعة وتقريرها؟ (أي أن group_a تتلقى تقريرًا ببيانات group_a، وما إلى ذلك)
لا يوجد (حاليًا) اتصال بين قائمة المستلمين ومعلمات التقرير، لذلك لتحقيق ذلك ستحتاج إلى إعداد أتمتة واحدة لكل مجموعة. في هذه الحالة، قد ترغب في تغيير المعلمة إلى group_id.
3 إعجابات