<#1366 Consider exposing config like `dry_run_reco...
# meltano-repo-activity
g
#1366 Consider exposing config like
dry_run_record_limit
Issue created by aaronsteers We could theoretically expose a record limit in config for SDK-based taps. This would basically be a more advanced implementation of
--test
CLI flag. However, it is important to properly disclaim the following caveats for any users that opt into this behavior: 1. This mode will very likely break referential integrity expectations. • The 'first 100' records from the
orders
table, for instance, might not match all - or even any - of the customer IDs from the first 100 records of the customers table. 2. This mode will break incremental sync expectations for many taps. • There's no guarantee that this will align with paging requirements of the upstream source, and for many taps, you would not be able to simply "run it again" to get the next 100 records per stream. 3. The total number of records sent for child streams will be indeterminant, and could be unexpectedly more or less than the max. • If the first
n
parents don't have any children, then no records for the child stream would be synced. Example: I'm syncing with max count of
10
. My parent stream is
Issues
and my child stream is
Issue comments
. If my first 10 issues do not have comments, then exactly zero
Issue comments
records will be synced, even though the max for that stream type was never met. • Conversely, if the 10 parent streams each have exactly 5 child records (for instance), then the total records streams for the child stream will be 50, since each pass through the child streams would reset the counter. The total records synced could be therefor be much more than the max. • Both of these behaviors are tolerable if communicated clearly to users. Most example cases would not mind 50 records instead of 10 for child streams. And conversely, if child items are sparse, the user could increase the limit to something large enough to ensure at least one child item is sent. For these reasons, I suggest we pay special attention to naming. I propose above a
dry_run_
prefix but there are other ways this could be communicated as well. A similar approach would be something like
dry_run: true
to enable a developer-specified default (or the SDK default of something like 1000), possibly also allowing an integer instead of the boolean value
dry_run: 10
- with docs clearly explaining that
true
uses the built-in defaults and any other
n
will override the limit at the users' request. ## Alternative using the CLI An alternative using just the CLI would be to accept this integer as an optional input to
--test
. So,
--test
today tries to sync zero or one records per stream, where-as if
--test=N
were specified, we'd try to sync (at least)
N
records per stream. cc @kgpayne, @edgarrmondragon Related: • #1349 meltano/sdk