Releases¶
The changes in each version, from the package's NEWS.md.
0.4.2¶
-
The example for
operation_context_from_otel()now runs its traced case: with otelsdk installed, it records a trace in memory and shows the trace and span identifiers filled in from the active span. -
The tests pass with otelsdk 0.3.0, which leaves a span that ends without an error at the
"unset"status instead of"ok".
0.4.1¶
-
Reject envelope depth limits beyond R's integer range and avoid overflow when calculating JSON nesting limits.
-
Removed special classification for Rust-style module paths. The R package retains native R conditions and Python DataExcept envelope compatibility.
0.4.0¶
-
Read Rust DataExcept envelopes with
dataexcept::module paths as classed R conditions, preserving known error families and the original module name. -
Added an installed-package vignette introducing classed errors, retry metadata, Python-compatible envelopes and failure events. Open it with
browseVignettes("dataexcept").
0.3.0¶
Groups and wrapping¶
condition_group()reports several failures as one error, written to the envelope as an exception group -- theexceptionsarray Python'sExceptionGroupalso produces. Its message counts and lists the members, and its failure metadata is theirs when they agree.group_members()returns the members.collect_errors()evaluates each of its arguments, catching the errors they signal, so that a validation step can report every problem instead of the first.wrap_errors()re-signals an error from an expression as a dataexcept error, with the original as its cause: the R counterpart of the Python package'swrap(). It can wrap warnings too, and set failure metadata.- An envelope record with an
exceptionsarray, a PythonExceptionGroupincluded, is read back with the classdataexcept_condition_group. An emptyexceptionsarray is now kept when the condition is written back.
More condition types¶
Twenty-nine types from the Python package, with its names, fields, messages and default failure metadata. Each is tested against the envelope the Python package writes for the same arguments.
- Data quality:
data_format_error(),schema_mismatch_error(),data_drift_error(),data_leakage_error(),data_imbalance_error(),outlier_detection_error(). - Model quality:
model_evaluation_error(),cross_validation_error(),hyperparameter_error(),training_timeout_error(),overfitting_error(),underfitting_error(),model_serialization_error(),resource_limit_error(). - Pipelines and external services:
external_service_error(),service_timeout_error(),service_authentication_error(),service_authorization_error(),retry_limit_exceeded_error(),storage_error(), andtransaction_error()for databases. - Jobs, a new family caught by
dataexcept_job_error:authentication_error(),authorization_error(),configuration_error(),resource_not_found_error(),operation_timeout_error(). - Data engineering, a new family caught by
dataexcept_data_engineering_error:data_transformation_error(),etl_job_error(),batch_processing_error(). - Refused credentials and permissions are permanent and not retryable, as in
Python; the other new types are
"unknown". - An envelope of one of these types, written by Python, is now read back with
the type's R classes instead of plain
dataexcept_error. - Values in default messages are written as the Python package writes them:
a string in quotes (
Validation failed for field 'country': 'Atlantis'), in any locale; an integer without itsLsuffix; a fraction in the fewest digits that read back exactly. A URL in a value is redacted before a long value is shortened, so shortening cannot hide credentials from redaction. - An empty
messagefalls back to the default message in the constructors whose Python class does the same (validation_error(),api_error(),database_connection_error(),host_unreachable_error()and most of the new job and pipeline errors).
More classed warnings¶
- Templates can carry values. A rule's template may be a format string, such
as
"did not converge in %d iterations"; the values its placeholders match are stored on the classed warning and written to the envelope as attributes. Plural messages are matched in every form of the session language, and translations that reorder their values are read in their own order.classed_warning_rules()gains afieldscolumn. - New rules:
kmeans()andmedpolish()stopping at the iteration limit,arima()whenoptim()does not converge, rank tests that cannot compute an exact p-value because of ties or zeroes (cor.test(),wilcox.test(),ansari.test(),ks.test()), survival's Cox model warnings (an infinite coefficient, running out of iterations), and lme4's convergence checks and singular fits. - Each rule is tested against the real warning, raised by the function that
raises it; lme4 and survival join
Suggestsfor those tests.
Pino¶
condition_to_pino()andcondition_to_pino_json()write a condition in the shape Pino logs errors: the Pino profile the Python package publishes, a projection of the envelope in which group members areerrors, attributes stay nested, andstackappears only when there is a real one -- an rlang backtrace, withinclude_stack = TRUE.- Backtraces are written without terminal colour codes, here and in
record_otel_exception()'sexception.stacktrace, whatever colour support the session has. envelope_to_pino()projects an envelope already in hand, as JSON or as a list.pino_schema()returns the profile's JSON Schema, which ships with the package together with the Python package's projection of every reference envelope. The tests require R to reproduce each one exactly.
Fixes¶
- On macOS on Apple silicon, numbers in envelopes were sometimes written with
a seventeenth digit they did not need (
0.95238095238095233for 20/21). They are now written in the shortest form that reads back exactly, as on other platforms and as the Python package writes them.
0.2.0¶
Observability¶
operation_context()records where a failure happened: labels for filtering (system,component,operation) and identifiers of one run (request_id,job_id,correlation_id,trace_id,span_id), with the fields and rules of the Python package'sOperationContext.operation_index_fields()returns the labels.condition_to_event()andcondition_to_event_json()write a failure event, the envelope plus its operation context, in the format of the Python package'sexception_to_observability_event().condition_to_otel_attributes()describes a condition as OpenTelemetry exception attributes with the Python package's names.record_otel_exception()records a condition on an OpenTelemetry span, the active span of the otel package by default. It is fail-open, and its redacted attributes replace the unredacted message and stack trace the otel SDK would otherwise record. It also sets the span's status to error (set_status = TRUE), which stops the SDK from recording the same failure a second time, unredacted, when it escapes the span.operation_context_from_otel()fills a context'strace_idandspan_idfrom the active span, so failure events in logs correlate with traces.- otel and otelsdk join
Suggests. Events and attributes are tested against output generated by the Python package, and recording against the real SDK.
0.1.0¶
First release.
Classed errors¶
- Constructors for data frame, data and modelling, file, database, network and
API failures, each storing its arguments as fields:
validation_error(),missing_column_error(),dtype_mismatch_error(),merge_key_error(),data_loading_error(),missing_data_error(),model_training_error(),convergence_error(),prediction_error(),file_read_error(),file_write_error(),database_connection_error(),query_execution_error(),host_unreachable_error(),connection_timeout_error()andapi_error(). new_dataexcept_error()defines your own.dataexcept_classes()lists the hierarchy.- Leaf type names are shared with the Python DataExcept package.
Failure metadata¶
failure_metadata(),with_failure_metadata(),condition_failure()andis_retryable(). Validation failures default to permanent and not retryable; everything else defaults to unknown, as in the Python package.
The envelope¶
condition_to_envelope()andcondition_to_json()write any condition, with its chain of causes, as a DataExcept envelope (schema 1.0.0). Text is always valid UTF-8: bytes that are not are replaced, at construction and on export.envelope_to_condition()reads an envelope from either language back into an R condition, mapping DataExcept types onto the R classes. A type from a DataExcept module that R has no class for, such as Python'sServiceTimeoutError, is still adataexcept_error, so adataexcept_errorhandler catches it andis_retryable()reads its failure record.condition_type()returns the envelope type of any condition, including one read from an envelope.validate_envelope()andis_envelope()check a payload against the schema's rules.envelope_schema()returns the schema.- Reading untrusted envelopes is bounded by
max_depth(default 32): a deeper chain of records is rejected before it is walked, and JSON nested deeper than an envelope could need is rejected before it is parsed, with adataexcept_envelope_error. - All eight of the Python package's reference fixtures round-trip exactly.
Redaction¶
redact_url()andredact_urls_in_text()port the Python package's rules and match its output exactly on the parity cases in the test suite. Conditions are redacted at construction and envelopes on export.
Classed warnings¶
with_classed_warnings()andclassify_warning()re-signal fifteen base R and stats warning templates -- non-convergence, separation, boundary fits, rank-deficient prediction, the chi-squared approximation, zero variance, coercion, recycling,NaNproduction and non-numeric arguments -- as classed warnings, recognised in any session language.classed_warning_rules()lists them.
Documentation and project¶
- A documentation site, built with MkDocs Material and deployed to GitHub Pages, with the API reference generated from the help pages: https://diogoribeiro7.github.io/r-dataexcept/.
- Contributing, security and conduct policies, issue and pull-request
templates, and CI for
R CMD check(R 4.1 to devel on three platforms), lint, style, spelling, coverage, the envelope contract and the documentation site. Releases are cut by pushing a version tag.