locked
Lazy Evaluation Error when uploading to Model in Power BI Desktop RRS feed

  • Question

  • Let's have this code in PBID (as you understand I HAVE 3 Queries in PBID UI), AND DO NOT MARK any of the queries to be uploaded to model:

    Section 1;
    
    shared F = (x) => x;
    
    shared T = 
    let
        Источник = #table({"C"}, {{"sdfsdfsd"}}),
        #"Добавлен пользовательский объект" = Table.AddColumn(Источник, "Пользовательская", each R[F]([C]))
    in
        #"Добавлен пользовательский объект";
    
    shared R = [F = F, T = T];

    All works fine while I refresh Data in PQ UI.

    BUT if T is marked "load to model", after I close PQ UI AND press "update" button, PBID closes silently.

    In Excel all works fine.

    So it's definitely a bug. Please could you say when it may be fixed?



    Wednesday, July 3, 2019 3:22 PM

Answers

  • Hi Andrey. Thanks for reporting this. I was able to reproduce the crash, but only by modifying the T query to include a third step that references the first one (skipping over the step that causes the circular reference). Otherwise, I couldn't get into a state where T was loadable. But by leaving the second, circular step in place, and then creating a non-circular third step, I was able to repro the crash.

    I've filed a bug and we'll look into it.

    Ehren


    Tuesday, July 9, 2019 5:17 PM

All replies

  • Hi Andrey,

    this is a code to be used in a custom connector and not something you can use in the query editor.


    Imke Feldmann - MVP Data Platform (PowerBI) - http://www.TheBIccountant.com 

    Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to vote it as helpful - Thanks!

    Sunday, July 7, 2019 5:11 AM
  • Hey,

    Based on your sample section, I recreated the 3 queries that you have in there and it appears that you have a cyclic reference between the R & T queries.

    My best guess is that in the Power Query editor you're working with a cached version of your code which did not have this cyclic reference. 

    You just need to fix your cyclic reference and you'll be good to go.

    Sunday, July 7, 2019 4:08 PM
  • Hi Imke!

    Of course I meant creating 3 appropriate queries in PQ UI. I used such a notation in order to describe the situation shorter and more precise.

    I tried to use capital S in "Section" in order to make a clue to that approach.
    Monday, July 8, 2019 7:50 AM
  • Hi Miguel!

    It would be cyclic reference if M wouldn't be a partly lazy evaluated language, or I would upload R to model. But record must be lazy evaluated (according to PQM language specification), and this code must work, because, if I don't upload R to model, field T of R must not be evaluated.

    And it works in Excel without problem if I upload just T to model.

    I don't think that there is something like "cashed code" in PQ.

    Monday, July 8, 2019 7:55 AM
  • Hi Andrey. Thanks for reporting this. I was able to reproduce the crash, but only by modifying the T query to include a third step that references the first one (skipping over the step that causes the circular reference). Otherwise, I couldn't get into a state where T was loadable. But by leaving the second, circular step in place, and then creating a non-circular third step, I was able to repro the crash.

    I've filed a bug and we'll look into it.

    Ehren


    Tuesday, July 9, 2019 5:17 PM