@@ -635,14 +635,11 @@ cdef class Buffer:
635635 self._set_marker()
636636 try:
637637 self._table(table_name)
638- if not (symbols or columns):
639- raise IngressError(
640- IngressErrorCode.InvalidApiCall,
641- 'Must specify at least one symbol or column')
642638 if symbols is not None:
643639 for name, value in symbols.items():
644- self._symbol(name, value)
645- wrote_fields = True
640+ if value is not None:
641+ self._symbol(name, value)
642+ wrote_fields = True
646643 if columns is not None:
647644 for name, value in columns.items():
648645 if value is not None:
@@ -663,7 +660,7 @@ cdef class Buffer:
663660 self,
664661 table_name: str,
665662 *,
666- symbols: Optional[Dict[str, str]]=None,
663+ symbols: Optional[Dict[str, Optional[ str] ]]=None,
667664 columns: Optional[Dict[
668665 str,
669666 Union[None, bool, int, float, str, TimestampMicros, datetime]]
@@ -672,14 +669,12 @@ cdef class Buffer:
672669 """
673670 Add a single row (line) to the buffer .
674671
675- At least one ``symbols`` or ``columns`` must be specified.
676-
677672 .. code- block:: python
678673
679674 # All fields specified.
680675 buffer .row(
681676 ' table_name' ,
682- symbols = {' sym1' : ' abc' , ' sym2' : ' def' },
677+ symbols = {' sym1' : ' abc' , ' sym2' : ' def' , ' sym3 ' : None },
683678 columns = {
684679 ' col1' : True ,
685680 ' col2' : 123 ,
@@ -741,12 +736,16 @@ cdef class Buffer:
741736
742737 :param table_name: The name of the table to which the row belongs.
743738 :param symbols: A dictionary of symbol column names to ``str `` values.
739+ As a convenience, you can also pass a ``None `` value which will
740+ have the same effect as skipping the key: If the column already
741+ existed, it will be recorded as ``NULL ``, otherwise it will not be
742+ created.
744743 :param columns: A dictionary of column names to ``bool ``, ``int ``,
745744 ``float ``, ``str ``, ``TimestampMicros`` or ``datetime`` values.
746- As a convenience, you can also pass a ``None `` value, however - due
747- to ILP protocol limitations - this will skip the column rather
748- necessarily writing a ``NULL `` value, so if the column did not exist
749- yet it will not be created.
745+ As a convenience, you can also pass a ``None `` value which will
746+ have the same effect as skipping the key: If the column already
747+ existed, it will be recorded as ``NULL ``, otherwise it will not be
748+ created.
750749 :param at: The timestamp of the row. If ``None ``, timestamp is assigned
751750 by the server. If ``datetime``, the timestamp is converted to
752751 nanoseconds. A nanosecond unix epoch timestamp can be passed
0 commit comments