Closed datalord123 closed 4 years ago
azure resource manager has a different format for URL than the one that is shown as the endpoint in powerbi.
Using this endpoint works. Found in the powerbi dataflow settings section.
model_endpoint = "https://cdmstoragepowerbi.dfs.core.windows.net/powerbi/WideWorldImporters/WideWorldImporters-Sales/model.json"
This issue is for a: (mark with an
x
)Minimal steps to reproduce
model_endpoint = "https://cdmstoragepowerbi.blob.core.windows.net/powerbi/WideWorldImporters%2FWideWorldImporters-Sales%2Fmodel.json"
When I then tried to initialize the model_json variable in this line of code
aad_token = generate_aad_token() --->model_json = read_from_adls(endpoint = model_endpoint, auth = aad_token).json() model = CdmModel.Model.fromJson(model_json)
it failed and gave the following error. Is it because i gave it the wrong filepath endpoint?![Jupyter_Error](https://user-images.githubusercontent.com/12159949/79699651-d593ee80-825e-11ea-8891-10dacf91fef0.PNG)
Any log messages given by the failure
Expected/desired behavior
c:\users\mattb\appdata\local\programs\python\python37\lib\site-packages\requests\models.py in json(self, kwargs) 888 try: 889 return complexjson.loads( --> 890 self.content.decode(encoding), kwargs 891 ) 892 except UnicodeDecodeError:
c:\users\mattb\appdata\local\programs\python\python37\lib\json__init__.py in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw) 346 parse_int is None and parse_float is None and 347 parse_constant is None and object_pairs_hook is None and not kw): --> 348 return _default_decoder.decode(s) 349 if cls is None: 350 cls = JSONDecoder
c:\users\mattb\appdata\local\programs\python\python37\lib\json\decoder.py in decode(self, s, _w) 335 336 """ --> 337 obj, end = self.raw_decode(s, idx=_w(s, 0).end()) 338 end = _w(s, end).end() 339 if end != len(s):
c:\users\mattb\appdata\local\programs\python\python37\lib\json\decoder.py in raw_decode(self, s, idx) 353 obj, end = self.scan_once(s, idx) 354 except StopIteration as err: --> 355 raise JSONDecodeError("Expecting value", s, err.value) from None 356 return obj, end
JSONDecodeError: Expecting value: line 1 column 1 (char 0)
OS and Version?
Windows 10
Versions
Mention any other details that might be useful