How to remove label prefix in errors - simple-form

How do I remove the prefix that is added to errors?
For example, given this error:
activerecord:
errors:
models:
my_model:
my_custom_error: Incorrect value
I'd like the input to show the error as exactly "Incorrect value". But instead SimpleForm always adds the name of the attribute as a prefix. So it shows as "my_custom_error Incorrect value".
How can I remove the prefix for some inputs?
Seems like the prefix is added here: https://github.com/heartcombo/simple_form/blob/main/lib/simple_form/components/errors.rb#L30

The label + message format comes from this I18n:
errors:
format: "%{attribute} %{message}"
So you need to redefine it to:
errors:
format: "%{message}"

Related

ImageSegmentationAnnotation Class seems to not work while giving the path to the annotations BitMaps

I am not able to figure out correct Key, Value names to pass out bitmap labels to a Image Segmentation problem in vertex AI. My error message is below:
Error: Could not parse the line, json is invalid or the format does not match the input schema: Cannot find field: ImageSegmentationAnnotation.MaskAnnotation in message google.cloud.aiplatform.master.schema.ImageSegmentationIoFormat. for: gs://starry-embassy-363916-image/Figaro1k_json.jsonl line 3
Error: Could not parse the line, json is invalid or the format does not match the input schema: Cannot find field: ImageSegmentationAnnotation.MaskAnnotation in message
And the format of the .jsonl file I am giving is :
{"imageGcsUri": "gs://starry-embassy-363916-image/Figaro1k/Original/Training/Frame00003-org.jpg", "ImageSegmentationAnnotation.MaskAnnotation" : [{"mask_gcs_uri": "gs://starry-embassy-363916-image/Figaro1k/GT/Training/Frame00003-gt.pbm"}], "dataItemResourceLabels": {"aiplatform.googleapis.com/ml_use": "training"}}
TIA
I tried various combination of the ImageSegmentationAnnotation class as documented here:
https://cloud.google.com/vertex-ai/docs/reference/rpc/google.cloud.aiplatform.v1/schema#google.cloud.aiplatform.v1.schema.ImageSegmentationAnnotation
And here:
https://cloud.google.com/vertex-ai/docs/image-data/classification/prepare-data#json-lines_1

How to access field value in a JSR message with spring boot 2?

I would like to customize my error message in the following way:
Assume following declaration of a class Person:
#Size(min=10, max=250, message="{size.name}")
private String name;
Within the declared error message in ValidationMessages.properties I would like to output the field value as well, i.e. I would like to do something like this:
size.name = The name '${validatedvalue}' is invalid, its size must be between {min} and {max}
Assume the content of the field 'name' is “xyz”. Then the error message should look like this:
The name 'xyz' is invalid, its size must be between 10 and 250
The substitution for min and max works, but filed value i am getting as '' ,how can I do this for the field value?

How to fix 'undefined name' in flutter stream input validation?

I want to validate an input through the stream transformer function and I get an error when I pass in the value of the password as a 'pass/password' argument before the sink argument.
I tried different names but it's not working. It works fine with my email validator but I don't know why it's an error with the password validator although they are almost exactly the same.
final passValidate = StreamTransformer<String,String>.fromHandlers(
handleData: (pass,sink)
if (pass.length >4){
sink.add(pass);
}
else
{
sink.addError('wrong pass');
}
);
I expected the argument to be run normally but I get an error message of "Undefined name 'pass'.
Try correcting the name to one that is defined, or defining the name"

"Error: imported content is empty" when using =IMPORTXML() for a feed

If I input =IMPORTXML("http://dilbert.com/feed") I get all the feed content, but when I input =IMPORTXML("http://dilbert.com/feed","//updated")
I get #N/A: Error: imported content is empty.
Which XPath have I to use to return only the set of <updated> entries field?
P.S.: I don't want to use =IMPORTFEED() because it can return only some predefined feed item fields.
How about this? http://dilbert.com/feed is in a cell "A1".
=IMPORTXML(A1,"//*[local-name()='updated']")
Result :
Reference :
https://www.w3.org/TR/xpath/
If this was not what you want, I'm sorry.
Edit :
=IMPORTXML(A1,"//*[local-name()='entry']//*[local-name()='updated']")

Is it possible to print the created query, like shows up in error messages?

I really like how the error messages include a text string representing what the ReQL code looks like. Is it possible to get at this without forcing an error?
Example Error message:
RqlRuntimeError: No attribute `colors` in object:
{...}
in:
r.db("r_g").table("items").group("collection").ungroup().map(function(var_0) { return var_0("group").object(var_0("reduction")); }).concatMap(function(var_1) { return var_1("colors"); })
I'm wanting to get at the value after "in:" shown before I run() the query.
You can use .toString() like query.toString() (without .run(...))
It should use the same code as the one used to generate backtraces.
I opened an issue this morning to add it in the docs, it is somehow missing -- https://github.com/rethinkdb/docs/issues/354

Resources