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

Fix precommit errors #12500

Merged
merged 1 commit into from
Aug 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import static org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.rel.rel2sql.SqlImplementor.POS;

import java.util.Objects;
import java.util.function.IntFunction;
import org.apache.beam.repackaged.core.org.apache.commons.lang3.text.translate.CharSequenceTranslator;
import org.apache.beam.repackaged.core.org.apache.commons.lang3.text.translate.EntityArrays;
Expand Down Expand Up @@ -110,6 +111,26 @@ private static class SqlDateTimeLiteral extends SqlLiteral {
public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {
writer.literal("DATETIME '" + timestampString.toString() + "'");
}

@Override
Copy link
Member

Choose a reason for hiding this comment

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

@ZijieSong946 This class is a good candidate for AutoValue to eliminate this boilerplate.
(This got missed in #12348 because it was merged without a Jenkins run. cc: @robinyqiu )

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, my bad. I only run spotless and checkStyle locally but not spotBugs.

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it. Thanks for fixing that.

public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
if (!super.equals(o)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This check is a bit confusing. Why use super's equal to check an object of current class?

Something like super.equals((super) o) makes more sense (just pseudo code)

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah so this comes from #12348?

Copy link
Member Author

Choose a reason for hiding this comment

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

This was just automatically generated by IntelliJ

return false;
}
SqlDateTimeLiteral that = (SqlDateTimeLiteral) o;
return Objects.equals(timestampString, that.timestampString);
}

@Override
public int hashCode() {
return Objects.hash(super.hashCode(), timestampString);
}
}

private static class SqlByteStringLiteral extends SqlLiteral {
Expand Down
1 change: 0 additions & 1 deletion sdks/python/apache_beam/dataframe/expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import contextlib
import threading

from typing import Any
from typing import Callable
from typing import Iterable
Expand Down