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

Pretty Print Rust object when called from Python print #503

Merged
merged 1 commit into from
May 22, 2024

Conversation

haixuanTao
Copy link
Collaborator

This will make it possible to print dora event object within python for debugging purposes:

Ex:

print(dora_event)
Dora(
    Input {
        id: DataId(
            "image",
        ),
        metadata: Metadata {
            metadata_version: 0,
            timestamp: 664b45b2bfe51ff0/FC05639A0C7747D6BF87A894CEF83935,
            type_info: ArrowTypeInfo {
                data_type: UInt8,
                len: 65786,
                null_count: 0,
                validity: None,
                offset: 0,
                buffer_offsets: [
                    BufferOffset {
                        offset: 0,
                        len: 65786,
                    },
                ],
                child_data: [],
            },
            parameters: MetadataParameters {
                watermark: 0,
                deadline: 0,
                open_telemetry_context: "traceparent:00-392f4871c115bdaa8dd1e316187a03c5-55debb0964f25de8-01;tracestate:;",
            },
        },
        data: ArrowData(
            PrimitiveArray<UInt8>
            [
              255,
              216,
              255,
              224,
              0,
              16,
              74,
              70,
              73,
              70,
              ...65766 elements...,
              123,
              86,
              240,
              106,
              196,
              74,
              61,
              79,
              255,
              217,
            ],
        ),
    },
)

Copy link
Collaborator

@phil-opp phil-opp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@phil-opp phil-opp merged commit c7de69a into main May 22, 2024
17 checks passed
@phil-opp phil-opp deleted the pretty-print-event branch May 22, 2024 10:56
phil-opp added a commit that referenced this pull request May 22, 2024
Pretty Print Rust object when called from Python print
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

Successfully merging this pull request may close these issues.

2 participants