Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

notebook html_rendered does not support short profiling (no root frame). #349

Open
Carreau opened this issue Nov 20, 2024 · 0 comments
Open

Comments

@Carreau
Copy link
Contributor

Carreau commented Nov 20, 2024

I'm working again on adding the options to the IPython magic;

Often nothing is shown in the html view with a:

about:srcdoc:14 Uncaught TypeError: Cannot read properties of null (reading 'identifier') (from Frame constructor)

I've tracked that down to:

class JSONForHTMLRenderer(FrameRenderer):
...
    def render(self, session: Session) -> str:
        
        frame_tree_json_str = root_frame.to_json_str() if root_frame else "null"  # here
        
		return '{"session": %s, "frame_tree": %s}' % (session_json_str, frame_tree_json_str)

And the svelt.typescript Session is not built to handle the case where frame_tree is null:

export default class Session {
   ...

    constructor(data: SessionData) {
        ...
        this.rootFrame = new Frame(data.frame_tree, this) // Frame don't like null.
    }

Ok, it's an edge case that should likely almost never happen a usualy user profile things that actually take time; but just letting you know.

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

No branches or pull requests

1 participant