Skip to content

Commit

Permalink
Automated Code Change
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 684783267
  • Loading branch information
tensorflower-gardener authored and tensorflow-copybara committed Oct 11, 2024
1 parent 4943f27 commit 2570468
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ namespace {
using Hashmap = std::unordered_map<string, string>;

// Populates a hashmap from a file located at 'path', in format 'format'.
Status LoadHashmapFromFile(const string& path,
const HashmapSourceAdapterConfig::Format& format,
std::unique_ptr<Hashmap>* hashmap) {
absl::Status LoadHashmapFromFile(
const string& path, const HashmapSourceAdapterConfig::Format& format,
std::unique_ptr<Hashmap>* hashmap) {
hashmap->reset(new Hashmap);
switch (format) {
case HashmapSourceAdapterConfig::SIMPLE_CSV: {
Expand All @@ -61,7 +61,7 @@ Status LoadHashmapFromFile(const string& path,
return errors::InvalidArgument("Unrecognized format enum value: ",
format);
}
return Status();
return absl::Status();
}

} // namespace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ namespace {
using Hashmap = std::unordered_map<string, string>;

// Writes the given hashmap to a file.
Status WriteHashmapToFile(const HashmapSourceAdapterConfig::Format format,
const string& file_name, const Hashmap& hashmap) {
absl::Status WriteHashmapToFile(const HashmapSourceAdapterConfig::Format format,
const string& file_name,
const Hashmap& hashmap) {
std::unique_ptr<WritableFile> file;
TF_RETURN_IF_ERROR(Env::Default()->NewWritableFile(file_name, &file));
switch (format) {
Expand All @@ -63,7 +64,7 @@ Status WriteHashmapToFile(const HashmapSourceAdapterConfig::Format format,
format);
}
TF_RETURN_IF_ERROR(file->Close());
return Status();
return absl::Status();
}

TEST(HashmapSourceAdapter, Basic) {
Expand Down

0 comments on commit 2570468

Please sign in to comment.