Skip to content

Issue in model documentation #100

@kalebkemp

Description

@kalebkemp

Hi.. I'm not sure how useful this will be. I'm still digging to find out even what is causing this, or what is being pulled in as a "InferredPartitionSource" in my semantic model, so I'm not sure how I can help someone else to reproduce the issue. Everything that is working as expected is coming in as a "MPartitionSource" or "CalculatedPartitionSource".. I am getting this stack trace when attempting to generate documentation for some of our semantic models. If I can do anything to provide further info please let me know.

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[6], line 2
      1 docs = pytabular.ModelDocumenter(model)
----> 2 docs.generate_documentation_pages()
      3 docs.save_documentation()

File c:\Users\kkemp\AppData\Local\Programs\Python\Python312\Lib\site-packages\pytabular\document.py:112, in ModelDocumenter.generate_documentation_pages(self)
    110 """Generate Documentation for each specific part of the model."""
    111 self.measure_page = self.generate_markdown_measure_page()
--> 112 self.table_page = self.generate_markdown_table_page()
    113 self.general_page = self.generate_general_info_file()

File c:\Users\kkemp\AppData\Local\Programs\Python\Python312\Lib\site-packages\pytabular\document.py:464, in ModelDocumenter.generate_markdown_table_page(self)
    447 """This function generates the markdown for table documentation.
    448 
    449 Returns:
    450     str: Will be appended to the page text.
    451 """
    452 markdown_template = [
    453     "---",
    454     "sidebar_position: 2",
   (...)
    461     f"# Tables {self.model.Name}",
    462 ]
--> 464 markdown_template.extend(
    465     self.create_markdown_for_table(table) for table in self.model.Tables
    466 )
    467 return "\n".join(markdown_template)

File c:\Users\kkemp\AppData\Local\Programs\Python\Python312\Lib\site-packages\pytabular\document.py:465, in <genexpr>(.0)
    447 """This function generates the markdown for table documentation.
    448 
    449 Returns:
    450     str: Will be appended to the page text.
    451 """
    452 markdown_template = [
    453     "---",
    454     "sidebar_position: 2",
   (...)
    461     f"# Tables {self.model.Name}",
    462 ]
    464 markdown_template.extend(
--> 465     self.create_markdown_for_table(table) for table in self.model.Tables
    466 )
    467 return "\n".join(markdown_template)

File c:\Users\kkemp\AppData\Local\Programs\Python\Python312\Lib\site-packages\pytabular\document.py:429, in ModelDocumenter.create_markdown_for_table(self, object)
    427 else:
    428     partition_type = "sql"
--> 429     partition_source = object.Partitions[0].Source.Query
    431 obj_text = [
    432     f"### {object_caption}",
    433     "**Description**: ",
   (...)
    441     "---",
    442 ]
    444 return "\n".join(obj_text)

AttributeError: 'InferredPartitionSource' object has no attribute 'Query'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions