When from Wakanda I query or find on a 4D database table, object field, property.property value, the result is not what I expect. It is returning an entity with a non matching integer value, when the comparison operator is "===', or '=='.
I know that the Wakanda query is valid for the field name because it does not complain that the attribute is not found.
I know that the ObjectField.property.property value exists.
Please verify that 4D object field, properties can be queried/find from Wakanda, and that objectField.property.property can be queried/find.
Thanks!
The answer has been found. A bug report has been filed.
Related
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.
I want to return the index of my DataFrame as a string. I am using this commandp_h = peak_hour_df.index.astype(str).str.zfill(4) It is not working, I am getting this result: Index(['1645'], dtype='object', name I need it to return the string '1645' How do I accomplish this?
In short:
do p_h = list(peak_hour_df.index.astype(str).str.zfill(4)). This will return a list and then you can index it.
In more detail:
When you do peak_hour_df.index.astype(str), as you see, the dtype is already an object (string), so that job is done. Note this is the type of the contents; not of the object itself. Also I am removing .str.zfill(4) as this is additional and does not change the nature of the problem or the retuning type.
Then the type of the whole objet you are returning is pandas.core.indexes.base.Index. You can check this like so: type(peak_hour_df.index.astype(str)). If you want to return a single value from it in type str (e.g. the first value), then you can either index the pandas object directly like so:
peak_hour_df.index.astype(str)[0]
or (as I show above) you can covert to list and then index that list (for some reason, most people find it more intuitive):
peak_hour_df.index.astype(str).to_list()[0]
list(peak_hour_df.index.astype(str))[0]
I've encountered following error message when I've set Nested data type for such input ['abc', 'def', 'ghi'].
object mapping for [tags] tried to parse field [null] as object, but
found a concrete value
Please let me know which kind of datatype should I set for concrete value.
If it's an array of strings then use text datatype. if it's an array of objects use Nested datatype. See reference https://www.elastic.co/guide/en/elasticsearch/reference/current/array.html. the reason you've received this error it's because you've tried to index array of strings (concrete values) as Nested datatype but Nested datatype expects to see an object and not a string (concrete value). Also check this out https://discuss.elastic.co/t/object-mapping-for-configurationitems-configuration-state-tried-to-parse-field-state-as-object-but-found-a-concrete-value/80995
I'm currently using node-postgres to query my DB like so:
SELECT DISTINCT(name) FROM users.names ORDER BY name;
I want to return the lowercase of these names, so I've tried this:
SELECT DISTINCT(lower(name)) FROM users.names ORDER BY lower(name);
...but this just returns null in place of each name.
This solved it:
SELECT DISTINCT(LOWER(tag)) AS tag FROM support.tags ORDER BY LOWER(tag);
The key addition is obviously AS tag, otherwise the 'tag' field was renamed to 'lower' in the results set.
I have an array field which i would like to ensure that it has at least one element when a condition is met:
genre:Joi.array().includes(data.genres).when('field'{is:'fieldValue',then:Joi.required()})
If i changed the 'then' field with Joi.required().min(1), it complains.
Can i do this with Joi?
You didn't mention what the error message was, but testing your code I suppose you got:
TypeError: Object [object Object] has no method 'min'
This error occurs because min() is a function of the array type. In the then: part you create a new validation object and Joi doesn't know you expect an array there. So you need to specify it:
then: Joi.array().min(1).required()
The full validation code is:
genre: Joi.array().includes(data.genres).when('field', {is: 'fieldValue', then: Joi.array().min(1).required()})