microsoft/semantic-kernel · error · VectorStoreOperationException

Identifier cannot be empty

Error message

Identifier cannot be empty

What it means

Thrown by OracleCollection._validate_identifiers when an Oracle identifier (collection/table name, schema, or a field's storage_name/name) is empty. The connector validates names up front because Oracle rejects empty identifiers and they would produce malformed quoted SQL.

Source

Thrown at python/semantic_kernel/connectors/oracle.py:487

                oracledb.DB_TYPE_RAW,
                arraysize=cursor.arraysize,
                outconverter=lambda b: uuid.UUID(bytes=b) if b is not None else None,
            )

        return None

    @override
    def _serialize_dicts_to_store_models(self, records: Sequence[dict[str, Any]], **kwargs: Any) -> Sequence[Any]:
        """Serialize a list of dicts of the data to the store model. Pass the records through without modification."""
        return records

    def _validate_identifiers(self, name: str) -> None:
        """Validate Oracle identifier to disallow embedded double quotes.

        Since quoted identifiers are not allowed, any double quote is invalid.
        """
        if not name:
            raise VectorStoreOperationException("Identifier cannot be empty")

        if '"' in name:
            raise VectorStoreOperationException(f"Invalid identifier with quotes: {name}")

    def _build_check_table_exists_query(self) -> tuple[str, dict[str, str]]:
        """Build SQL + bind variables for checking table existence.

        - If schema is provided, query ALL_TABLES.
        - If no schema, query USER_TABLES.
        """
        if self.db_schema:
            sql = """
                SELECT 1
                FROM   all_tables
                WHERE  owner = :owner
                AND    table_name = :tbl
            """
            bind_vars = {

View on GitHub (pinned to c028a0c7dc)

Solutions

  1. Provide a non-empty collection_name (the Oracle table name)
  2. Ensure every field has a non-empty name (and storage_name if set)
  3. Provide a non-empty db_schema only if you intend to use one
  4. Sanitize config-derived names before passing them to the collection

Example fix

# before
OracleCollection(record_type=MyModel, collection_name='')  # raises 1513

# after
OracleCollection(record_type=MyModel, collection_name='documents')
Defensive patterns

Strategy: validation

Validate before calling

def is_valid_identifier(name: str | None) -> bool:
    return bool(name) and isinstance(name, str)

for name in [collection_name, db_schema, *(f.storage_name or f.name for f in all_fields)]:
    if name is not None and not is_valid_identifier(name):
        raise ValueError(f'Identifier cannot be empty')

Type guard

def is_nonempty_identifier(name: object) -> bool:
    return isinstance(name, str) and len(name.strip()) > 0

Try / catch

from semantic_kernel.exceptions import VectorStoreOperationException

try:
    collection = OracleCollection(record_type=MyModel, collection_name=name)
except VectorStoreOperationException as e:
    if 'Identifier cannot be empty' in str(e):
        # supply a non-empty collection_name / field names
        ...

Prevention

When it happens

Trigger: collection_name='' (or omitted where the table name is required); db_schema='' ; a VectorStoreField whose name and storage_name both resolve to ''.

Common situations: Forgetting to set collection_name; definition missing field names; loading names from config that came back empty; programmatically generating names that yielded ''.

Related errors


AI-assisted analysis of microsoft/semantic-kernel@c028a0c7dc (2026-08-13). Data as JSON: /api/errors/9b195c63b4646c6f. Report an issue: GitHub.