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

SNOW-1480779 Support Method Chain in the Telemetry #121

Merged
merged 20 commits into from
Jul 22, 2024
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package com.snowflake.snowpark_java.types;

/** The Snowflake class provides access to the CloudProviderToken secret object with the following properties: accessKeyId,
* secretAccessKey, and token.*/

/**
* The Snowflake class provides access to the CloudProviderToken secret object with the following
* properties: accessKeyId, secretAccessKey, and token.
*/
public class CloudProviderToken {
private final String accessKeyId;
private final String secretAccessKey;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ public UsernamePassword getUsernamePassword(String secretName) {
}

/**
* Get the Cloud provider token from the secret. On success, it returns a valid object with access key id,
* secret access key and token.
* Get the Cloud provider token from the secret. On success, it returns a valid object with access
* key id, secret access key and token.
*
* @param secretName name of the secret object.
*/
Expand Down
16 changes: 11 additions & 5 deletions src/main/scala/com/snowflake/snowpark/CopyableDataFrame.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ import com.snowflake.snowpark.internal.analyzer._
class CopyableDataFrame private[snowpark] (
override private[snowpark] val session: Session,
override private[snowpark] val plan: SnowflakePlan,
override private[snowpark] val methodChain: Seq[String],
private val stagedFileReader: StagedFileReader)
extends DataFrame(session, plan) {
extends DataFrame(session, plan, methodChain) {

/**
* Executes a `COPY INTO <table_name>` command to
Expand Down Expand Up @@ -238,7 +239,7 @@ class CopyableDataFrame private[snowpark] (
* @group basic
*/
override def clone: CopyableDataFrame = action("clone", 2) {
new CopyableDataFrame(session, plan, stagedFileReader)
new CopyableDataFrame(session, plan, Seq(), stagedFileReader)
}

/**
Expand All @@ -261,11 +262,12 @@ class CopyableDataFrame private[snowpark] (

@inline override protected def action[T](funcName: String)(func: => T): T = {
val isScala: Boolean = this.session.conn.isScalaAPI
OpenTelemetry.action("CopyableDataFrame", funcName, isScala)(func)
OpenTelemetry.action("CopyableDataFrame", funcName, methodChainString, isScala)(func)
}
@inline protected def action[T](funcName: String, javaOffset: Int)(func: => T): T = {
val isScala: Boolean = this.session.conn.isScalaAPI
OpenTelemetry.action("CopyableDataFrame", funcName, isScala, javaOffset)(func)
OpenTelemetry.action("CopyableDataFrame", funcName, methodChainString, isScala, javaOffset)(
func)
}
}

Expand Down Expand Up @@ -360,6 +362,10 @@ class CopyableDataFrameAsyncActor private[snowpark] (cdf: CopyableDataFrame)

@inline override protected def action[T](funcName: String)(func: => T): T = {
val isScala: Boolean = cdf.session.conn.isScalaAPI
OpenTelemetry.action("CopyableDataFrameAsyncActor", funcName, isScala)(func)
OpenTelemetry.action(
"CopyableDataFrameAsyncActor",
funcName,
cdf.methodChainString + ".async",
isScala)(func)
}
}
Loading
Loading