Skip to content

Commit

Permalink
requisitions and applications (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianswms authored Dec 20, 2024
1 parent 1e08671 commit 7c9557a
Show file tree
Hide file tree
Showing 5 changed files with 1,644 additions and 13 deletions.
17 changes: 4 additions & 13 deletions generate_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os
from genson import SchemaBuilder
from tap_adp.tap import TapADP
from tap_adp.streams import WorkersStream, PayrollInstructionStream, PayDataInputStream, USTaxProfileStream
from tap_adp.streams import JobRequisitionStream, JobApplicationStream
from dotenv import load_dotenv
from decimal import Decimal

Expand Down Expand Up @@ -67,22 +67,13 @@ def main():
tap = TapADP(config=config)

# Configure this part as-needed for the streams you want to generate schemas for.
parent = WorkersStream(tap=tap)
children = {
"payroll_instruction": PayrollInstructionStream(tap=tap),
"pay_data_input": PayDataInputStream(tap=tap),
"us_tax_profile": USTaxProfileStream(tap=tap),
"job_requisition": JobRequisitionStream(tap=tap),
"job_application": JobApplicationStream(tap=tap),
}


gen = parent.get_records(context=None)
first = next(gen, None)
if not first:
raise RuntimeError("no parent entries found")
context = parent.get_child_context(record=first, context=None)

for child_name, child_stream in children.items():
generate_schema(child_stream, context=context, output_file=f'tap_adp/schemas/{child_name}.json')
generate_schema(child_stream, context=None, output_file=f'tap_adp/schemas/{child_name}.json')

if __name__ == '__main__':
main()
Loading

0 comments on commit 7c9557a

Please sign in to comment.