SDITools / adobeanalyticsr

R Client for Adobe Analytics API v2.0
Other
18 stars 9 forks source link

`aw_segment_table` fails with named vectors of segments #112

Closed charlie-gallagher closed 2 years ago

charlie-gallagher commented 2 years ago

It's common for us at IXIS to organize our segments as named character vectors. This should be allowed, and should potentially override the automatic renaming that occurs in this function (with a consequent speed increase, I think?)

# Works
aw_segment_table(
  segmentIds = c("s1383_5a5f8f3601c1ebaa704c7818")
)

# Fails
aw_segment_table(
  segmentIds = c("_Inventory Results Page (Hit)" = "s1383_5a5f8f3601c1ebaa704c7818")
)
charlie-gallagher commented 2 years ago

The problem is actually with aw_get_segments, which fails if your list of segment IDs is named. @benrwoodard I'm thinking aw_get_segments should ignore names if provided -- specifically you can see what goes wrong after line 69 of the function. I know of other functions that fail if something is named, so maybe we should triage this all at once