Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi,
I want to perform a GET request in R visual and am using HTTR library to do this. While this works in Power BI desktop, the R visual does not display in Power BI service.
I get an error:
[1] "unknown" Error in iconv(x, "latin1", "ASCII") : unsupported conversion from 'latin1' to 'ASCII' in codepage 1252
Please try again later or contact support. If you contact support, please provide these details.
Here is the code snippet:
library(httr) x <- dataset[1,1] call <- "http://168.61.16.151/score?&p1_delay=0.1&p2_delay=2&p3_delay=50&p4_delay=0.15&Authorization=Bearer,NWIFwYUcRF1toCtEkdA9NMhgDuNZVTwx" calla <-iconv(call, to = "UTF-8") gta <- GET(calla) plot(1,1) title(sub=x)
Strangely, calla <-iconv(call, to = "UTF-8") does not throw any runtime errors.
On trying to pinpoint the issue, I have removed all library usage, and see that I still get a runtime error:
[1] "unknown" Error in iconv(call, to = "ASCII") : unsupported conversion from '' to 'ASCII' in codepage 1252
Please try again later or contact support. If you contact support, please provide these details.
I am using this sample code:
x <- dataset[1,1] call <- "http://168.61.16.151/score?&p1_delay=0.1&p2_delay=2&p3_delay=50&p4_delay=0.15&Authorization=Bearer,NWIFwYUcRF1toCtEkdA9NMhgDuNZVTwx" calla <-iconv(call, to = "ASCII") plot(1,1) title(sub=x)
Any help is very much appreciated!
Thanks!
Hi @RRay,
I have reported this issue to the Product Team: CRI 94253393. I will update the process here.
Best Regards,
Dale
Hi Ratna,
I have gotten the result that says "outgoing calls from R visuals in the service isn't supported". The calls from R visuals could be expensive in my opinion.
Can you retrieve the data into Power BI first as a query? It could work around this limitation.
Best Regards,
Dale
Hi Dale,
I am not sure I follow; can you please explain?
Let me try to explain the context for this: We pick the slicer values selected by the user, and pass these as into an R visual as datasets. Within the visual, these are used as parameters into a ML Web API endpoint. Which it why it has to be a GET call from the R visual. We parse the json response to a text. To do this, we only need the httr and stringr libraries, both supported by Power BI Service: https://docs.microsoft.com/en-us/power-bi/service-r-packages-support#r-packages-that-are-supported-i...
We figured out that this isn't a problem with the libraries, because a normal conversion also throws the same error message in Power BI Service. Can you suggest any other alternatives?
Thanks,
Ratna
Hi Ratna,
Actually, there are two parts of R on Power BI. One is the R visual while the other is R script as a data source. The responses from the Product Team say the call from R visual isn't supported, which means the R visual only can use the local dataset.
The workaround could be loading all the data and then interact with R visual. The Httr is supported when it's used in the data source. I tested it. Please give it a try and give some feedback if you can.
Best Regards,
Dale
Thank you Dale,
We do see that the call works in a Power BI data source.
Strangely, the documentation mentions that this is supported in R visuals in the Power BI service: https://docs.microsoft.com/en-us/power-bi/visuals/service-r-visuals."R visuals in the Power BI service are supported by the packages found in the Supported Packages section found in this article"
While this does say that Power BI Service supports R visuals using only packages in CRAN; so I was wondering if RODBC is also unsupported? To be able to load all the data, we want to use Azure SQL DB, and we are getting an error "first argument is not an open RODBC channel"
Are we doing something wrong? Here is the code snippet:
library(RODBC) connectionString <- paste0("Driver=", Driver, ";Server=", Server, ";Database=", Database, ";Uid=", User, ";Pwd=", Password) sqlQuery <- "SELECT 1 FROM dbo.ARM" conn <- odbcDriverConnect(connectionString) df <- sqlQuery(conn, sqlQuery) close(conn)
Thanks,
Ratna Ray
@RRay ,
We do not support outgoing calls from R visuals in the service.
This should be documented (and support for httr removed unless it is used for something else).
Regards,
Jimmy Tao
Takk skal du ha!