dropdown_data_sources

class virtualitics_sdk.elements.dropdown_data_sources.DataSourceDropdown(user_id, options, selected=None, include_nulls_visible=True, include_nulls_value=False, title='', description='', show_title=True, show_description=True, required=True, label='', placeholder='')

Bases: Dropdown

Used to configure data source drop down options that have been set up in the Connections tab.

Parameters:
  • user_id (str) – the user_id of the owner of the connections, usually done via StoreInterface.user.

  • options (List[ConnectionType]) – a list of ConnectionTypes, for example ConnectionType.mssql.

  • selected (Optional[List[str]]) – used if you want a default selection.

  • include_nulls_visible (bool) – whether null values will be visible.

  • include_nulls_value (bool) – whether to include null values.

  • title (str) – the title of the drop-down element.

  • description (str) – the description of the drop-down element.

  • show_title (bool) – whether to show the title.

  • show_description (bool) – whether to show the description.

  • required (bool) – whether selecting an item from the dropdown is required to proceed.

  • label (str) – the label of the element.

  • placeholder (str) – the placeholder of the element.

EXAMPLE:

# Imports 
from virtualitics_sdk.elements.dropdown_data_sources import DataSourceDropdown
. . .
# Example usage
class ExampleStep(Step):
  def run(self, flow_metadata):
    . . . 
    api_key_selection = DataSourceDropdown(user_id=store_interface.user,
                                           options=[ConnectionType.s3, ConnectionType.other],
                                           title='Select API Credential')

The above DataSourceDropdown example will be displayed as:

../_images/dropdown_data_ex.png
static conn2dropdown_str(filter_options, user_id)
static dropdown_str2conn(user_id, connection_str)
get_value()

Get the value of an element. If the user has interacted with the value, the default will be updated.

Return type:

Union[str, dict]