Kubernetes-client/go - trying this example
Note: I am using go.mod file
Do you know why I get this Azure error?
go run .
# github.com/kubernetes-client/go/kubernetes/config
../../gopath/pkg/mod/github.com/kubernetes-client/go#v0.0.0-20190402190921-ee48eb4f6eed/kubernetes/config/azure.go:63:3: cannot use l.user.AuthProvider.Config["expires-in"] (type string) as type json.Number in field value
../../gopath/pkg/mod/github.com/kubernetes-client/go#v0.0.0-20190402190921-ee48eb4f6eed/kubernetes/config/azure.go:64:3: cannot use l.user.AuthProvider.Config["expires-in"] (type string) as type json.Number in field value
Related
I have one parameter created which is of type "SecureString" . I want to use that directly in any AddDynamiccontent box .
But it throws me the error like its ecpecting the type string but the passed is "SecureString"
How to pass /convert it?
Now to convert to string :
Output :
So to get Specific value:
Output:
I want to use a string I've created in a for loop to determine the dtypes of a Dataframe to send through sqlalchemy.
dtype_str = "'var1' : sqlalchemy.types.VARCHAR(8), 'var2' : sqlalchemy.types.VARCHAR(4)"
df.to_sql('table',connect,dtype={dtype_str})
When I run that I get an error saying "ValueError: The type of var1 is not a SQLAlchemy type.
If I just copy and paste it into without the quotes it works. I'm trying to build something that can work on different datasets so I don't want to have to copy/paste that string each time.
I'm trying to use PySpark's split() method on a column that has data formatted like:
[6b87587f-54d4-11eb-95a7-8cdcd41d1310, 603, landing-content, landing-content-provider]
my intent is to extract the 4th element after the last comma.
I'm using a syntax like:
mydf.select("primary_component").withColumn("primary_component_01",f.split(mydf.primary_component, "\,").getItem(0)).limit(10).show(truncate=False)
But I'm consistently getting this error:
"cannot resolve 'split(mydf.primary_component, ',')' due to data
type mismatch: argument 1 requires string type, however,
'mydf.primary_component' is of
structuuid:string,id:int,project:string,component:string
type.;;\n'Project [primary_component#17,
split(split(primary_component#17, ,)[1], \,)...
I've also tried escaping the "," using \, \\ or not escaping it at all and this doesn't make any difference. Also, removing the ".getItem(0)" produces no difference.
What am I doing wrong? Feeling a dumbass but I don't know how to fix this...
Thank you for any suggestions
You are getting the error:
"cannot resolve 'split(mydf.`primary_component`, ',')' due to data
type mismatch: argument 1 requires string type, however,
'mydf.`primary_component`' is of
struct<uuid:string,id:int,project:string,component:string>
because your column primary_component is using a struct type when split expects string columns.
Since primary_component is already a struct and you are interested in the value after your last comma you may try the following using dot notation
mydf.withColumn("primary_component_01","primary_component.component")
In the error message, spark has shared the schema for your struct as
struct<uuid:string,id:int,project:string,component:string>
i.e.
column
data type
uuid
string
id
int
project
string
component
string
For future debugging purposes, you may use mydf.printSchema() to show the schema of the spark dataframe in use.
enter image description here
select from list by index ${locator_var} ${inp_msge_type}
--getting error as expected string, int found
select from list by index ${locator_var} 7
-----not getting any error
${inp_msge_type}----contains 7 from DB query the result is stored in this variable, to avoid hard coding we need to do this
Is there any way to write
Do not add links to screenshots of code, or error messages, and format the code pieces accordingly - use the ` (tick) symbol to surround them.
The rant now behind us, your issue is that the keyword Select From List By Index expects the type of the index argument to be a string.
When you called it
Select From List By Index ${locator_var} 7
, that "7" is actually a string (though it looks like a number), because this is what the framework defaults to on any typed text. And so it works.
When you get the value from the DB, it is of the type that the DB stores it with; and probably the table schema says it is int. So now you pass an int to the keyword - and it fails.
The fix is simple - just cast (convert) the variable to a string type:
${inp_msge_type}= Convert To String ${inp_msge_type}
, and now you can call the keyword as you did before.
Excel workbooks have a CustomDocumentProperties collection. This collection is of type DocumentProperties and has an Add method that I'm attempting to call from MATLAB.
If I call the invoke method on the collection I see:
>> workbook.CustomDocumentProperties.invoke
Item = handle Item(handle, Variant, int32)
Add = handle Add(handle, string, bool, int32, Variant(Optional))
I assume this means the Add method requires a string, boolean, int32, and an optional variant, and this matches with the Microsoft documentation for the Add method.
However, all combination of inputs I've tried to this function result in an error. For example:
workbook.CustomDocumentProperties.Add('MyProp', true, int32(1), true);
Results in the error:
Invoke Error: Incorrect number of arguments
If I supply 7 or more arguments then I get the error:
Error: Invalid number is arguments. This method can take maximum 6 arguments
If I supply anything other than a string as the first argument I get the error:
No method 'Add' with matching signature found for class 'Interface.2DF8D04D_5BFA_101B_BDE5_00AA0044DE52'.
Has anyone successfully used this function to add a custom property to an Excel workbook from MATLAB?