Skip to content

post_lineage_event

post_lineage_event(
    event: LineageEvent, *, config_overrides: Optional[GlueClientConfig] = None
) -> PostLineageEventResponse

Publishes a lineage event to the Glue Data Catalog. The event describes a run and the datasets that it reads and writes. Glue uses the event to build the lineage graph that you retrieve with GetLineageNode.

Parameters:

  • event (LineageEvent) –

    The lineage event that you want to post, in OpenLineage format. Supported event types are run events and dataset events.

Raises:

Source code in docs_src/capo_glue/_services/glue.py
def post_lineage_event(
    self,
    event: "capo_glue.types.lineage_event.LineageEvent",
    *,
    config_overrides: Optional[GlueClientConfig] = None,
) -> "capo_glue.types.post_lineage_event_response.PostLineageEventResponse":
    """<p>Publishes a lineage event to the Glue Data Catalog. The event describes a run and the datasets that it reads and writes. Glue uses the event to build the lineage graph that you retrieve with <code>GetLineageNode</code>.</p>

    Args:
        event: <p>The lineage event that you want to post, in OpenLineage format. Supported event types are run events and dataset events.</p>

    Raises:
        capo_glue.errors.access_denied_exception.AccessDeniedException: <p>Access to a resource was denied.</p>
        capo_glue.errors.conflict_exception.ConflictException: <p>The <code>CreatePartitions</code> API was called on a table that has indexes enabled. </p>
        capo_glue.errors.internal_service_exception.InternalServiceException: <p>An internal service error occurred.</p>
        capo_glue.errors.invalid_input_exception.InvalidInputException: <p>The input provided was not valid.</p>
        capo_glue.errors.resource_number_limit_exceeded_exception.ResourceNumberLimitExceededException: <p>A resource numerical limit was exceeded.</p>
        capo_glue.errors.throttling_exception.ThrottlingException: <p>The throttling threshhold was exceeded.</p>
        capo_glue.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_glue.types.post_lineage_event_request.PostLineageEventRequest]",
    ) -> OperationResponse[
        "capo_glue.types.post_lineage_event_response.PostLineageEventResponse"
    ]:
        import capo_glue._operations.aws_glue.post_lineage_event

        output, http_response = (
            capo_glue._operations.aws_glue.post_lineage_event.post_lineage_event(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_glue.types.post_lineage_event_request.PostLineageEventRequest",
    ) -> dict[str, Any]:
        import capo_glue.types.post_lineage_event_request

        return capo_glue.types.post_lineage_event_request.redact_sensitive(input_)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("PostLineageEvent", redact_input=_redact_input),
    )
    input_: capo_glue.types.post_lineage_event_request.PostLineageEventRequest = {
        "event": event
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output