Skip to content

Commit 791b186

Browse files
petrmikheevcopybara-github
authored andcommitted
Fix a typo
PiperOrigin-RevId: 861777244 Change-Id: Ia2c0cb40bf418db70f4b0dd26f58225d9d3840c8
1 parent 219bbd7 commit 791b186

File tree

8 files changed

+55
-54
lines changed

8 files changed

+55
-54
lines changed

koladata/data_slice.cc

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -403,11 +403,11 @@ absl::StatusOr<DataSlice::AttrNamesSet> GetAttrsFromDataSlice(
403403
return result.value_or(DataSlice::AttrNamesSet());
404404
}
405405

406-
auto KodaErrorCausedByIncompableSchemaError(const DataBagPtr& lhs_bag,
407-
const DataBagPtr& rhs_bag,
408-
const DataSlice& ds) {
406+
auto KodaErrorCausedByIncompatibleSchemaError(const DataBagPtr& lhs_bag,
407+
const DataBagPtr& rhs_bag,
408+
const DataSlice& ds) {
409409
return [&](auto&& status_like) {
410-
RETURN_IF_ERROR(KodaErrorCausedByIncompableSchemaError(
410+
RETURN_IF_ERROR(KodaErrorCausedByIncompatibleSchemaError(
411411
std::forward<decltype(status_like)>(status_like), lhs_bag, rhs_bag,
412412
ds));
413413
ABSL_UNREACHABLE();
@@ -1749,8 +1749,8 @@ absl::StatusOr<DataSlice> DataSlice::GetFromDict(const DataSlice& keys) const {
17491749
/*overwrite_schema=*/false);
17501750
RETURN_IF_ERROR(keys_handler.ProcessSchema(*this, GetBag()->GetImpl(),
17511751
fb_finder.GetFlattenFallbacks()))
1752-
.With(KodaErrorCausedByIncompableSchemaError(GetBag(), keys.GetBag(),
1753-
*this))
1752+
.With(KodaErrorCausedByIncompatibleSchemaError(GetBag(), keys.GetBag(),
1753+
*this))
17541754
.With(KodaErrorCausedByMissingCollectionItemSchemaError(GetBag()));
17551755
ASSIGN_OR_RETURN(auto res_schema, VisitImpl([&](const auto& impl) {
17561756
return GetResultSchema(GetBag()->GetImpl(), impl,
@@ -1800,16 +1800,16 @@ absl::Status DataSlice::SetInDict(const DataSlice& keys,
18001800
/*overwrite_schema=*/false);
18011801
RETURN_IF_ERROR(keys_handler.ProcessSchema(*this, db_mutable_impl,
18021802
/*fallbacks=*/{}))
1803-
.With(KodaErrorCausedByIncompableSchemaError(GetBag(), keys.GetBag(),
1804-
*this))
1803+
.With(KodaErrorCausedByIncompatibleSchemaError(GetBag(), keys.GetBag(),
1804+
*this))
18051805
.With(KodaErrorCausedByMissingCollectionItemSchemaError(GetBag()));
18061806
RhsHandler</*is_readonly=*/false> values_handler(
18071807
RhsHandlerContext::kDict, expanded_values, schema::kDictValuesSchemaAttr,
18081808
/*overwrite_schema=*/false);
18091809
RETURN_IF_ERROR(values_handler.ProcessSchema(*this, db_mutable_impl,
18101810
/*fallbacks=*/{}))
1811-
.With(KodaErrorCausedByIncompableSchemaError(GetBag(), values.GetBag(),
1812-
*this))
1811+
.With(KodaErrorCausedByIncompatibleSchemaError(GetBag(), values.GetBag(),
1812+
*this))
18131813
.With(KodaErrorCausedByMissingCollectionItemSchemaError(GetBag()));
18141814

18151815
adoption_queue.Add(keys);
@@ -2104,8 +2104,8 @@ absl::Status DataSlice::SetInList(const DataSlice& indices,
21042104
/*overwrite_schema=*/false);
21052105
RETURN_IF_ERROR(data_handler.ProcessSchema(*this, db_mutable_impl,
21062106
/*fallbacks=*/{}))
2107-
.With(KodaErrorCausedByIncompableSchemaError(GetBag(), values.GetBag(),
2108-
*this))
2107+
.With(KodaErrorCausedByIncompatibleSchemaError(GetBag(), values.GetBag(),
2108+
*this))
21092109
.With(KodaErrorCausedByNoCommonSchemaError(GetBag()));
21102110
if (std::holds_alternative<internal::DataItem>(
21112111
expanded_this.internal_->impl)) {
@@ -2156,8 +2156,8 @@ absl::Status DataSlice::ReplaceInList(int64_t start,
21562156
/*overwrite_schema=*/false);
21572157
RETURN_IF_ERROR(data_handler.ProcessSchema(*this, db_mutable_impl,
21582158
/*fallbacks=*/{}))
2159-
.With(KodaErrorCausedByIncompableSchemaError(GetBag(), values.GetBag(),
2160-
*this))
2159+
.With(KodaErrorCausedByIncompatibleSchemaError(GetBag(), values.GetBag(),
2160+
*this))
21612161
.With(KodaErrorCausedByMissingCollectionItemSchemaError(GetBag()));
21622162

21632163
internal::DataBagImpl::ListRange list_range(start, stop);

koladata/error_repr_utils.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -411,10 +411,10 @@ absl::StatusOr<std::string> FormatMissingCollectionItemSchemaError(
411411
}
412412
} // namespace
413413

414-
absl::Status KodaErrorCausedByIncompableSchemaError(absl::Status status,
415-
const DataBagPtr& lhs_bag,
416-
const DataBagPtr& rhs_bag,
417-
const DataSlice& ds) {
414+
absl::Status KodaErrorCausedByIncompatibleSchemaError(absl::Status status,
415+
const DataBagPtr& lhs_bag,
416+
const DataBagPtr& rhs_bag,
417+
const DataSlice& ds) {
418418
if (const internal::IncompatibleSchemaError* incompatible_schema_error =
419419
arolla::GetPayload<internal::IncompatibleSchemaError>(status);
420420
incompatible_schema_error != nullptr) {
@@ -428,13 +428,13 @@ absl::Status KodaErrorCausedByIncompableSchemaError(absl::Status status,
428428
return status;
429429
}
430430

431-
absl::Status KodaErrorCausedByIncompableSchemaError(
431+
absl::Status KodaErrorCausedByIncompatibleSchemaError(
432432
absl::Status status, const DataBagPtr& lhs_bag,
433433
absl::Span<const DataSlice> rhs_slices, const DataSlice& ds) {
434434
std::vector<DataBagPtr> dbs(rhs_slices.size());
435435
absl::c_transform(rhs_slices, dbs.begin(),
436436
[](const DataSlice& ds) { return ds.GetBag(); });
437-
return KodaErrorCausedByIncompableSchemaError(
437+
return KodaErrorCausedByIncompatibleSchemaError(
438438
std::move(status), lhs_bag, DataBag::ImmutableEmptyWithFallbacks(dbs),
439439
ds);
440440
}

koladata/error_repr_utils.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ absl::Status KodaErrorCausedByMissingCollectionItemSchemaError(
3333

3434
// Clarifies the error if it is caused by incompatible schema. Otherwise,
3535
// returns the status unchanged.
36-
absl::Status KodaErrorCausedByIncompableSchemaError(absl::Status status,
37-
const DataBagPtr& lhs_bag,
38-
const DataBagPtr& rhs_bag,
39-
const DataSlice& ds);
36+
absl::Status KodaErrorCausedByIncompatibleSchemaError(absl::Status status,
37+
const DataBagPtr& lhs_bag,
38+
const DataBagPtr& rhs_bag,
39+
const DataSlice& ds);
4040

4141
// Clarifies the error if it is caused by incompatible schema. Otherwise,
4242
// returns the status unchanged.
43-
absl::Status KodaErrorCausedByIncompableSchemaError(
43+
absl::Status KodaErrorCausedByIncompatibleSchemaError(
4444
absl::Status status, const DataBagPtr& lhs_bag,
4545
absl::Span<const DataSlice> slices, const DataSlice& ds);
4646

koladata/error_repr_utils_test.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ TEST(ReprUtilTest, TestAssembleError_IncompatibleSchema) {
9090
.assigned_schema = schema_2.item(),
9191
};
9292

93-
absl::Status status = KodaErrorCausedByIncompableSchemaError(
93+
absl::Status status = KodaErrorCausedByIncompatibleSchemaError(
9494
arolla::WithPayload(absl::InvalidArgumentError("error"),
9595
std::move(error)),
9696
bag, bag, schema_1);
@@ -121,7 +121,7 @@ TEST(ReprUtilTest, TestAssembleError_IncompatibleSchema_SameContent_DiffId) {
121121
.assigned_schema = schema_2.item(),
122122
};
123123

124-
absl::Status status = KodaErrorCausedByIncompableSchemaError(
124+
absl::Status status = KodaErrorCausedByIncompatibleSchemaError(
125125
arolla::WithPayload(absl::InvalidArgumentError("error"),
126126
std::move(error)),
127127
bag, bag, schema_1);

koladata/object_factories.cc

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -448,21 +448,21 @@ absl::Status AdoptValuesInto(absl::Span<const DataSlice> values,
448448
return adoption_queue.AdoptInto(db);
449449
}
450450

451-
auto KodaErrorCausedByIncompableSchemaError(const DataBagPtr& lhs_bag,
452-
absl::Span<const DataSlice> slices,
453-
const DataSlice& result_ds) {
451+
auto KodaErrorCausedByIncompatibleSchemaError(
452+
const DataBagPtr& lhs_bag, absl::Span<const DataSlice> slices,
453+
const DataSlice& result_ds) {
454454
return [&lhs_bag, slices, &result_ds](auto&& status_like) {
455-
return KodaErrorCausedByIncompableSchemaError(
455+
return KodaErrorCausedByIncompatibleSchemaError(
456456
std::forward<decltype(status_like)>(status_like), lhs_bag, slices,
457457
result_ds);
458458
};
459459
}
460460

461-
auto KodaErrorCausedByIncompableSchemaError(const DataBagPtr& lhs_bag,
462-
const DataBagPtr& rhs_bag,
463-
const DataSlice& ds) {
461+
auto KodaErrorCausedByIncompatibleSchemaError(const DataBagPtr& lhs_bag,
462+
const DataBagPtr& rhs_bag,
463+
const DataSlice& ds) {
464464
return [&lhs_bag, &rhs_bag, &ds](auto&& status_like) {
465-
return KodaErrorCausedByIncompableSchemaError(
465+
return KodaErrorCausedByIncompatibleSchemaError(
466466
std::forward<decltype(status_like)>(status_like), lhs_bag, rhs_bag, ds);
467467
};
468468
}
@@ -496,7 +496,7 @@ absl::StatusOr<DataSlice> CreateEntitiesImpl(
496496
}
497497
ASSIGN_OR_RETURN(DataSlice res, create_entities_fn(schema_item));
498498
RETURN_IF_ERROR(res.SetAttrs(attr_names, values, overwrite_schema))
499-
.With(KodaErrorCausedByIncompableSchemaError(db, values, res));
499+
.With(KodaErrorCausedByIncompatibleSchemaError(db, values, res));
500500
// Adopt into the databag only at the end to avoid garbage in the databag in
501501
// case of error.
502502
// NOTE: This will cause 2 merges of the same DataBag, if schema comes from
@@ -528,7 +528,7 @@ absl::StatusOr<DataSlice> CreateObjectsImpl(
528528
return absl::OkStatus();
529529
}));
530530
RETURN_IF_ERROR(res.SetAttrs(attr_names, values))
531-
.With(KodaErrorCausedByIncompableSchemaError(db, values, res));
531+
.With(KodaErrorCausedByIncompatibleSchemaError(db, values, res));
532532
// Adopt into the databag only at the end to avoid garbage in the databag
533533
// in case of error.
534534
RETURN_IF_ERROR(AdoptValuesInto(values, *db));
@@ -581,8 +581,8 @@ absl::StatusOr<DataSlice> EntityCreator::FromAttrs(
581581
CastOrUpdateSchema(values[i], schema_item, attr_names[i],
582582
overwrite_schema, db_mutable_impl),
583583
// Adds the db from schema to assemble readable error message.
584-
KodaErrorCausedByIncompableSchemaError(_, db, values[i].GetBag(),
585-
values[i]));
584+
KodaErrorCausedByIncompatibleSchemaError(_, db, values[i].GetBag(),
585+
values[i]));
586586
}
587587
ASSIGN_OR_RETURN(
588588
aligned_values, shape::Align(std::move(casted_values)),
@@ -802,7 +802,8 @@ absl::StatusOr<DataSlice> CreateUu(
802802
aligned_values.begin()->GetShape(),
803803
std::move(schema_item), db));
804804
RETURN_IF_ERROR(ds.SetAttrs(attr_names, aligned_values, overwrite_schema))
805-
.With(KodaErrorCausedByIncompableSchemaError(ds.GetBag(), values, ds));
805+
.With(
806+
KodaErrorCausedByIncompatibleSchemaError(ds.GetBag(), values, ds));
806807
// Adopt into the databag only at the end to avoid garbage in the
807808
// databag in case of error. NOTE: This will cause 2 merges of the
808809
// same DataBag, if schema comes from the same DataBag as values.
@@ -1240,8 +1241,8 @@ absl::StatusOr<DataSlice> CreateListShaped(
12401241
InitItemIdsForLists));
12411242
if (values.has_value()) {
12421243
RETURN_IF_ERROR(result.AppendToList(*values))
1243-
.With(KodaErrorCausedByIncompableSchemaError(result.GetBag(),
1244-
values->GetBag(), result));
1244+
.With(KodaErrorCausedByIncompatibleSchemaError(
1245+
result.GetBag(), values->GetBag(), result));
12451246
}
12461247
return std::move(result);
12471248
}
@@ -1282,8 +1283,8 @@ absl::StatusOr<DataSlice> CreateListLike(
12821283
InitItemIdsForLists));
12831284
if (values.has_value()) {
12841285
RETURN_IF_ERROR(result.AppendToList(*values))
1285-
.With(KodaErrorCausedByIncompableSchemaError(result.GetBag(),
1286-
values->GetBag(), result));
1286+
.With(KodaErrorCausedByIncompatibleSchemaError(
1287+
result.GetBag(), values->GetBag(), result));
12871288
}
12881289
return result;
12891290
}

koladata/operators/core.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ absl::StatusOr<DataBagPtr> Attrs(const DataSlice& obj, bool overwrite_schema,
210210
RETURN_IF_ERROR(obj.WithBag(result_db).SetAttrs(attr_names, attr_values,
211211
overwrite_schema))
212212
.With([&](absl::Status status) {
213-
return KodaErrorCausedByIncompableSchemaError(
213+
return KodaErrorCausedByIncompatibleSchemaError(
214214
std::move(status), obj.GetBag(), result_db, obj);
215215
});
216216
result_db->UnsafeMakeImmutable();
@@ -243,7 +243,7 @@ absl::StatusOr<DataBagPtr> AttrsForAttrNameSlice(const DataSlice& obj,
243243
RETURN_IF_ERROR(
244244
obj.WithBag(result_db).SetAttr(attr_names, attr_values, overwrite_schema))
245245
.With([&](absl::Status status) {
246-
return KodaErrorCausedByIncompableSchemaError(
246+
return KodaErrorCausedByIncompatibleSchemaError(
247247
std::move(status), obj.GetBag(), result_db, obj);
248248
});
249249
result_db->UnsafeMakeImmutable();

koladata/operators/lists.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ absl::StatusOr<DataSlice> ListAppended(const DataSlice& x,
183183
auto result,
184184
CreateListLike(result_db, x, std::move(list_items), x.GetSchema()));
185185
RETURN_IF_ERROR(result.AppendToList(append)).With([&](absl::Status status) {
186-
return KodaErrorCausedByIncompableSchemaError(std::move(status), x.GetBag(),
187-
append.GetBag(), x);
186+
return KodaErrorCausedByIncompatibleSchemaError(
187+
std::move(status), x.GetBag(), append.GetBag(), x);
188188
});
189189
return result.UnsafeMakeWholeOnImmutableDb();
190190
}
@@ -206,7 +206,7 @@ absl::StatusOr<DataBagPtr> ListAppendUpdate(const DataSlice& x,
206206
RETURN_IF_ERROR(AdoptStub(result_db, x));
207207
RETURN_IF_ERROR(x.WithBag(result_db).AppendToList(append))
208208
.With([&](absl::Status status) {
209-
return KodaErrorCausedByIncompableSchemaError(
209+
return KodaErrorCausedByIncompatibleSchemaError(
210210
std::move(status), x.GetBag(), append.GetBag(), x);
211211
});
212212
result_db->UnsafeMakeImmutable();

py/koladata/types/data_slice.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ int PyDataSlice_setattro(PyObject* self, PyObject* attr_name, PyObject* value) {
407407
status = adoption_queue.AdoptInto(*self_ds.GetBag());
408408
}
409409
if (!status.ok()) {
410-
arolla::python::SetPyErrFromStatus(KodaErrorCausedByIncompableSchemaError(
410+
arolla::python::SetPyErrFromStatus(KodaErrorCausedByIncompatibleSchemaError(
411411
std::move(status), self_ds.GetBag(), value_ds.GetBag(), self_ds));
412412
return -1;
413413
}
@@ -455,7 +455,7 @@ PyObject* absl_nullable PyDataSlice_set_attr(PyObject* self,
455455
RETURN_IF_ERROR(self_ds.SetAttr(attr_name_view, value_ds, overwrite_schema))
456456
.With([&](absl::Status status) {
457457
return arolla::python::SetPyErrFromStatus(
458-
KodaErrorCausedByIncompableSchemaError(
458+
KodaErrorCausedByIncompatibleSchemaError(
459459
std::move(status), self_ds.GetBag(), value_ds.GetBag(),
460460
self_ds));
461461
});
@@ -468,7 +468,7 @@ PyObject* absl_nullable PyDataSlice_set_attr(PyObject* self,
468468
RETURN_IF_ERROR(self_ds.SetAttr(*attr_name, value_ds, overwrite_schema))
469469
.With([&](absl::Status status) {
470470
return arolla::python::SetPyErrFromStatus(
471-
KodaErrorCausedByIncompableSchemaError(
471+
KodaErrorCausedByIncompatibleSchemaError(
472472
std::move(status), self_ds.GetBag(), value_ds.GetBag(),
473473
self_ds));
474474
});
@@ -506,7 +506,7 @@ PyObject* absl_nullable PyDataSlice_set_attrs(PyObject* self,
506506
.With([&](absl::Status status) {
507507
// TODO: b/361573497 - Move both adoption and error handling to SetAttr.
508508
return arolla::python::SetPyErrFromStatus(
509-
KodaErrorCausedByIncompableSchemaError(
509+
KodaErrorCausedByIncompatibleSchemaError(
510510
std::move(status), self_ds.GetBag(), values, self_ds));
511511
});
512512
RETURN_IF_ERROR(adoption_queue.AdoptInto(*self_ds.GetBag()))
@@ -710,7 +710,7 @@ PyObject* absl_nullable PyDataSlice_append(PyObject* self,
710710
RETURN_IF_ERROR(self_ds.AppendToList(items.WithBag(self_ds.GetBag())))
711711
.With([&](absl::Status status) {
712712
return arolla::python::SetPyErrFromStatus(
713-
KodaErrorCausedByIncompableSchemaError(
713+
KodaErrorCausedByIncompatibleSchemaError(
714714
std::move(status), self_ds.GetBag(), items.GetBag(), self_ds));
715715
});
716716
Py_RETURN_NONE;

0 commit comments

Comments
 (0)