Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Issue in model documentation #100

Open
kalebkemp opened this issue Jan 7, 2025 · 1 comment
Open

Issue in model documentation #100

kalebkemp opened this issue Jan 7, 2025 · 1 comment

Comments

@kalebkemp
Copy link

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'
@kalebkemp
Copy link
Author

For now, to achieve what I was trying to achieve locally, I change my code to exclude things where table.IsHidden

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant