Skip to content

Commit 342ec47

Browse files
committed
test
1 parent 98b3bff commit 342ec47

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

python/pyspark/sql/connect/dataframe.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1703,10 +1703,10 @@ def __getattr__(self, name: str) -> "Column":
17031703
errorClass="JVM_ATTRIBUTE_NOT_SUPPORTED", messageParameters={"attr_name": name}
17041704
)
17051705

1706-
# if name not in self.columns:
1707-
# raise PySparkAttributeError(
1708-
# errorClass="ATTRIBUTE_NOT_SUPPORTED", messageParameters={"attr_name": name}
1709-
# )
1706+
if name not in self.columns:
1707+
raise PySparkAttributeError(
1708+
errorClass="ATTRIBUTE_NOT_SUPPORTED", messageParameters={"attr_name": name}
1709+
)
17101710

17111711
return self._col(name)
17121712

@@ -1739,14 +1739,14 @@ def __getitem__(
17391739
# ConnectColumn(addDataFrameIdToCol(resolve(colName)))
17401740
# }
17411741

1742-
# # validate the column name
1743-
# if not hasattr(self._session, "is_mock_session"):
1744-
# from pyspark.sql.connect.types import verify_col_name
1745-
#
1746-
# # Try best to verify the column name with cached schema
1747-
# # If fails, fall back to the server side validation
1748-
# if not verify_col_name(item, self._schema):
1749-
# self.select(item).isLocal()
1742+
# validate the column name
1743+
if not hasattr(self._session, "is_mock_session"):
1744+
from pyspark.sql.connect.types import verify_col_name
1745+
1746+
# Try best to verify the column name with cached schema
1747+
# If fails, fall back to the server side validation
1748+
if not verify_col_name(item, self._schema):
1749+
self.select(item).isLocal()
17501750

17511751
return self._col(item)
17521752
elif isinstance(item, Column):

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ColumnResolutionHelper.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import org.apache.spark.sql.connector.catalog.{CatalogManager, Identifier}
3434
import org.apache.spark.sql.errors.{DataTypeErrorsBase, QueryCompilationErrors}
3535
import org.apache.spark.sql.internal.SQLConf
3636

37+
// scalastyle:off println
3738
trait ColumnResolutionHelper extends Logging with DataTypeErrorsBase {
3839

3940
def conf: SQLConf

0 commit comments

Comments
 (0)