Читать книгу SAS Viya - Kevin D. Smith - Страница 34

Partial Option Name Matches

Оглавление

As we have seen with swat.set_option and swat.option_context, you can use keyword arguments if the last segment of the option name is unique among all the options. You can also use the same technique with the option names using positional string arguments. In addition, in all of the functions, you can specify any number of the trailing segments as long as they match only one option name. For example, all of the following lines of code are equivalent:

In [88]: swat.set_option('cas.dataset.max_rows_fetched', 500)

In [89]: swat.set_option('dataset.max_rows_fetched', 500)

In [90]: swat.set_option('max_rows_fetched', 500)

The swat.describe_option also works with patterns that match the beginning of multiple option names. This means that you can display all cas.dataset options by just giving the cas.dataset prefix as an argument to swat.describe_option.

In [91]: swat.describe_option('cas.dataset')

cas.dataset.max_rows_fetched : int

The maximum number of rows to fetch with methods that use

the table.fetch action in the background (i.e. the head, tail,

values, etc. of CASTable).

[default: 3000] [currently: 500]

cas.dataset.auto_castable : boolean

Should a column of CASTable objects be automatically

created if a CASLib and CAS table name are columns in the data?

NOTE: This applies to all except the 'tuples' format.

[default: True] [currently: True]

This same technique also works to reset a group of options using swat.reset_option. In either case, you must specify full segment names (for example, cas.dataset), and not just any substring (for example, cas.data).

SAS Viya

Подняться наверх