Skip to content

BUG: Unable to use dot notation to access fields after upgrading to 4.7.2. #213

@m3thom

Description

@m3thom

Previously, on 4.7.0.pre.rc3, I could use dot notation to access fields just fine, but after upgrading to version 4.7.2, I can no longer use dot notation.
After I looked into the source code, there was no change to method_missing or respond_to_missing?.

Not sure what the source of this issue is.

Here is some example according to the document. https://docs.mindee.com/integrations/client-libraries-sdk/quick-start#ruby

# ruby 3.4.4
require 'mindee' # 4.7.2

input_path = '/path/to/the/file.ext'
api_key = 'MY_API_KEY'
model_id = 'MY_MODEL_ID'

# Init a new client
mindee_client = Mindee::ClientV2.new(api_key: api_key)

# Set inference parameters
inference_params = Mindee::Input::InferenceParameters.new(
    # ID of the model, required.
    model_id,
)

# Load a file from disk
input_source = Mindee::Input::Source::PathInputSource.new(input_path)

# Send for processing using polling
response = mindee_client.enqueue_and_get_inference(
    input_source,
    inference_params 
)

# Print a brief summary of the parsed data
puts response.inference.result.fields.supplier_address # 4.7.0.pre.rc3 works

puts response.inference.result.fields.supplier_address
#=> 4.7.2 NoMethodError: undefined method 'supplier_name' for an instance of Mindee::Parsing::V2::Field::InferenceFields (NoMethodError)
puts response.inference.result.fields.get('supplier_address')
#=> 4.7.2 works but my code base is using dot notation

Thank you !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions