Closed alvestobias closed 4 weeks ago
LookML dashboard files are defined in YAML and not LookML, so you should use a generic YAML parser like PyYAML for those!
On Tue Nov 5, 2024, 04:36 PM GMT, alvestobias @.***> wrote:
I'm having this error when trying to parse a dashboard file. It works normally with explore and views tho. Any idea what it might be? Thanks! load(stream) 48 else: 49 raise TypeError("Input stream must be a string or file object.") ---> 50 tree: DocumentNode = parse(text) 51 visitor = DictVisitor() 52 tree_as_dict: dict = visitor.visit(tree) 17 """Parse LookML into a parse tree. 18 19 Args: (...) 24 25 """ 26 lexer = Lexer(text) ---> 27 tokens = lexer.scan() 28 parser = Parser(tokens) 29 tree: DocumentNode = parser.parse() Lexer.scan(self) 90 self.advance() 91 self.tokens.append(tokens.ValueToken(self.line_number)) ---> 92 self.tokens.append(self.scan_expression_block()) 93 else: 94 # TODO: This should actually check for valid literals first 95 # and throw an error if it doesn't match 96 self.tokens.append(self.scan_literal()) in Lexer.scan_expression_block(self) 160 chars = "" 161 while self.peek_multiple(2) != ";;": --> 162 if self.peek() == "\n": 163 self.line_number += 1 164 chars += self.consume() def peek(self) -> str: 33 """Returns the character at the current index of the text being lexed.""" ---> 34 return self.text[self.index] IndexError: string index out of range — Reply to this email directly, view it on GitHub https://github.com/joshtemple/lkml/issues/95, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCFHK3WOPELDCEFELW26U3Z7DX2DAVCNFSM6AAAAABRG6UTGOVHI2DSMVQWIX3LMV43ASLTON2WKOZSGYZTKOJUGYYTGNY. You are receiving this because you are subscribed to this thread.Message ID: @.***>
I'm having this error when trying to parse a dashboard file. It works normally with explore and views tho. Any idea what it might be? Thanks!